Welcome Guest, Not a member yet? Register   Sign In
ERROR EXCEPTION while throwing an error
#1

(This post was last modified: 04-28-2020, 01:16 AM by harpreetsb.)

Hi,
Was working with php-amqplib
PHP Code:
try
        {
            
$this->connection = new AMQPStreamConnection(
                
'localhost',
                
5672,
                
$this->config->user,
                
$this->config->password,
            );
            
$this->channel    $this->connection->channel();
            
$this->channel->queue_declare($this->config->reviewQueueNamefalsefalsefalsefalse);
            
$this->channel->queue_declare($this->config->emailQueueNamefalsefalsefalsefalse);
            if (
is_cli())
            {
                
$this->commonLib->cliLog('Connected to rabbit MQ');
            }
        }
        catch (\
Exception $e)
        {
            if (
is_cli())
            {
                
$this->commonLib->cliLog('FAILED: could not connect to MQ');
                
$this->commonLib->cliLog("REASON: {$e->getMessage()}");
                
log_message('error'$e->getMessage());
            }
            else
            {
                throw new \
RuntimeException($e->getMessage(), $e->getCode());
            }
            exit();
        } 
Throwing error on at
PHP Code:
throw new \RuntimeException($e->getMessage(), $e->getCode()); 

gives following error (see image)

Quote:ErrorException #1

Uncaught ErrorException: htmlspecialchars() expects parameter 1 to be string, resource given in /var/www/html/revu/app/Views/errors/html/error_exception.php:182 Stack trace: #0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler() #1 /var/www/html/revu/app/Views/errors/html/error_exception.php(182): htmlspecialchars() #2 /var/www/html/revu/system/Debug/Exceptions.php(298): include('/var/www/html/r...') #3 /var/www/html/revu/system/Debug/Exceptions.php(171): CodeIgniter\Debug\Exceptions->render() #4 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler() #5 {main} thrown


Please help

Attached Files Thumbnail(s)
   
Reply




Theme © iAndrew 2016 - Forum software by © MyBB