protected function getRouterException($code) {
        $errors = [
            RouterInterface::ERROR_NOT_FOUND => NotFoundException::class,
            RouterInterface::ERROR_METHOD_NOT_ALLOWED => MethodNotAllowedException::class,
            '*' => NotSupportedException::class,
        ];
        $errorClass = isset($errors[$code]) ? $errors[$code] : $errors['*'];
        try {
            $exception = Reaction::create($errorClass);
        } catch (InvalidConfigException $createException) {
            return $createException;
        }
        return $exception;
    }
protected function getRouterException($code) {
        $errors = [
            RouterInterface::ERROR_NOT_FOUND => NotFoundException::class,
            RouterInterface::ERROR_METHOD_NOT_ALLOWED => MethodNotAllowedException::class,
            '*' => NotSupportedException::class,
        ];
        $errorClass = isset($errors[$code]) ? $errors[$code] : $errors['*'];
        try {
            $exception = Reaction::create($errorClass);
        } catch (InvalidConfigException $createException) {
            return $createException;
        }
        return $exception;
    }
protected function getRouterException ( $ code ) { $ errors = [ RouterInterface :: ERROR_NOT_FOUND => NotFoundException :: class , RouterInterface :: ERROR_METHOD_NOT_ALLOWED => MethodNotAllowedException :: class , '*' => NotSupportedException :: class , ] ; $ errorClass = isset ( $ errors [ $ code ] ) ? $ errors [ $ code ] : $ errors [ '*' ] ; try { $ exception = Reaction :: create ( $ errorClass ) ; } catch ( InvalidConfigException $ createException ) { return $ createException ; } return $ exception ; }
Get Exception by Router error code
@param int $code
@return \Throwable
Get Exception by Router error code