public function errorHandler($errno, $errstr, $errfile, $errline, array $errcontext = [])
    {
        $codes = array(
            256   => 'E_USER_ERROR',
            512   => 'E_USER_WARNING',
            1024  => 'E_USER_NOTICE',
            2048  => 'E_STRICT',
            4096  => 'E_RECOVERABLE_ERROR',
            8192  => 'E_DEPRECATED',
            16384 => 'E_USER_DEPRECATED',
            8     => 'E_NOTICE',
            2     => 'E_WARNING'
        );

        $message = 'Error of level ';
        if (array_key_exists($errno, $codes)) {
            $message .= $codes[$errno];
        } else {
            $message .= sprintf('Unknown error level, code of %d passed', $errno);
        }

        $message .= sprintf(
            '. Error message was "%s" in file %s at line %d.',
            $errstr,
            $errfile,
            $errline
        );

        // Log message
        $this->container['log']->error($message, $errcontext);
        $this->exceptionHandler(new InternalServerError('An unexpected error occurred.'));
    }