Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Wrong usage of ServerException #650

Copy link
Copy link
@jeff1985

Description

@jeff1985
Issue body actions

During testing of #648 configuration, I got an different issue with the usage of ServerException.

I.e. in enqueue/redis/RedisProducer.php:70 you have the following code:

catch (PRedisServerException $e) {
        throw new ServerException('lpush command has failed', null, $e);
    }

In case of an exception I'm getting:

[Symfony\Component\Debug\Exception\FatalThrowableError]
Wrong parameters for Enqueue\Redis\ServerException([string $message [, long $code [, 
Throwable $previous = NULL]]])

Which is because of the null parameter. ServerException is a subclass of \Exception and the __construct() is defined as:
(see http://php.net/manual/de/class.exception.php )

public __construct ([ string $message = "" [, int $code = 0 [, Throwable $previous = NULL ]]] )

null is not int, so you'll need to pass 0 in your exception calls.

For reference:

$ php -v 
PHP 7.1.19-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Jul  9 2018 13:12:24) ( NTS )
Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.