-
-
Couldn't load subscription status.
- Fork 109
Change error-handling from exceptions to returning a boolean #383
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
Conversation
In case an error occurs during loading of a context, let the Context::load() method return a boolean value indicating whether the context was successfully loaded or not. Throwing an Exception causes a false positive in debuggers,since the Context::load() method does the correct thing anyway
In case an error occurs during loading of a context, let the Context::load() method return a boolean value indicating whether the context was successfully loaded or not. Throwing an Exception causes a false positive in debuggers,since the Context::load() method does the correct thing anyway
Resolve Merge Conflict caused by ./vendor/bin/phpcbf
|
|
||
| if (isset(static::$KEYWORDS[$str])) { | ||
| if ($isReserved && ! (static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { | ||
| if ($isReserved && !(static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ($isReserved && !(static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { | |
| if ($isReserved && ! (static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { |
| public static function isOperator($str) | ||
| { | ||
| if (! isset(static::$OPERATORS[$str])) { | ||
| if (!isset(static::$OPERATORS[$str])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if (!isset(static::$OPERATORS[$str])) { | |
| if (! isset(static::$OPERATORS[$str])) { |
| } | ||
|
|
||
| if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (! static::isKeyword($str, true))) { | ||
| if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (!static::isKeyword($str, true))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (!static::isKeyword($str, true))) { | |
| if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) && (! static::isKeyword($str, true))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, can you squash the commits and also delete the LoaderException class file ?
|
By the way because this PR is open using your |
Sure, the important commits are now present on the exceptionRemoval branch
Done. The new branch is exceptionRemoval and is based off of the main branch. |
Thanks ! |
|
Duplicate of #384 |
When loading the Database Context using the Context::load() method, throwing a LoaderException triggers most, if not all debuggers e.g. Xdebug. However, this is a false positive since the caller of the Context::load() method catches the exception thrown and takes the necessary action which is to attempt and load the next closest context.
Hence I think it is more apt for Context::load() method to return a boolean indicating a success or failure, in order to deal with this problem of debuggers being falsely triggered.