Skip to content

[Notifier] Throw an exception when the Slack DSN is not valid #36516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

fabpot
Copy link
Member

@fabpot fabpot commented Apr 21, 2020

Q A
Branch? master
Bug fix? yes-ish
New feature? yes-ish
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

Improved errors in case of a DSN issue.

  • proper error for the Slack DSN when path is empty (will help catch when people haven't updated their Slack DSN for 5.1).

@@ -59,7 +60,10 @@ public static function fromString(string $dsn): self
$path = $parsedDsn['path'] ?? null;
parse_str($parsedDsn['query'] ?? '', $query);

return new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query, $path);
$dsnObject = new self($parsedDsn['scheme'], $parsedDsn['host'], $user, $password, $port, $query, $path);
$dsnObject->dsn = $dsn;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems that this property can be non-initialized in case when Dsn object constructed through standard public constructor. This can lead to errors during getOriginalDsn call

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, can you submit a PR to fix that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of course, will do

@fabpot fabpot mentioned this pull request May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants