Test if the entity exception is the result of a backup code exception

@param EntityException $e

@return bool
430905
public static function isBackupCodeException(EntityException $e)
    {
        if (in_array($e->getStatusCode(), array(RestStatusCodesInterface::REST_CLIENT_ERROR_CONFLICT, RestStatusCodesInterface::REST_CLIENT_ERROR_UNPROCESSABLE_ENTITY, RestStatusCodesInterface::REST_CLIENT_ERROR_LOCKED))
            && in_array($e->getJsonErrorCode(), self::getBackupCodeJsonStatusCodes())
        ) {
            return true;
        } else {
            return false;
        }
    }
749347
public static function log(Exception $e)
    {
        Base::getLog()->error($e->getMessage(), [
            'code' => $e->getCode(),
            'file' => $e->getFile(),
            'line' => $e->getLine(),
        ]);
    }
761953
protected static function assertFalseException(\Exception $e): bool
    {
        $msg = 'EXCEPTION: ' . $e->getMessage();
        $msg .= "\n    " . $e->getFile() . ' ('  . $e->getLine() . ')';
        self::assert(false, $msg);
    }
222875
protected function handleQueryException( $e, $query, $bindings ) {
		if ( $result = apply_filters( 'awethemes.database.handle_query_exception', null, $e, $query, $bindings ) ) {
			return $result;
		}

		throw $e;
	}
368779
public function handleException( \Throwable $e ) : bool
    {
        if ( $e instanceof HttpStatusException )
        {
            // Show HTTP error document
            $html = $this->provider->getErrorDocument( $e->getStatusCode() );
            
            // output html
            echo $html;

            return true;
        }

        return false;
    }
432513
protected function shouldntReport(Exception $e)
    {
        $dontReport = array_merge($this->dontReport, $this->internalDontReport);

        return ! is_null(Arr::first($dontReport, function ($type) use ($e) {
            return $e instanceof $type;
        }));
    }
292029
protected function editActionException(\Exception $e)
    {
        $this->handleException($e);
        $id = $this->get('request')->get($this->admin->getIdParameter());
        $object = $this->admin->getObject($id);

        return $this->redirectTo($object);
    }
560597
private function translateExceptionCode($e)
    {
        if (! in_array($e->getCode(), [0, -1, null, ''])) {
            return $e->getCode();
        }

        if (method_exists($e, 'getStatusCode')) {
            if (! in_array($e->getStatusCode(), [0, -1, null, ''])) {
                return $e->getStatusCode();
            }

            if (($statusCode = $this->getStatusCode()) != StatusCode::OK) {
                return $statusCode;
            }
        }

        if ($e instanceof \Illuminate\Database\Eloquent\ModelNotFoundException
            or $e instanceof \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
        ) {
            return StatusCode::NOT_FOUND;
        }

        return StatusCode::BAD_REQUEST;
    }
1249235
protected function shouldntHandle(Exception $e) {
        $dontHandle = array_merge($this->dontHandle, $this->absolutelyDontHandle);

        foreach ($dontHandle as $type) {
            if ($e instanceof $type) {
                return true;
            }
        }

        $sent_at = Cache::get($this->getCacheKey($e));
        if (empty($sent_at) || $sent_at->addSeconds(config('lern.ratelimit', 1))->lte(Carbon::now())) {
            return false; // The cache is empty or enough time has passed, so lets continue
        } else {
            return true;
        }
    }
45791
protected function shouldCatch(\Exception $e)
    {
        foreach ($this->exceptionClasses as $exceptionClass) {
            if (is_a($e, $exceptionClass, true)) {
                return true;
            }
        }

        return false;
    }
514345
private function isConnectionLost(\RedisException $e)
    {
        if (strpos($e->getMessage(), 'Redis server went away') !== false
            || strpos($e->getMessage(), 'Connection lost') !== false
            || strpos($e->getMessage(),
                'read error on connection') !== false
        ) {
            return true;
        }

        return false;
    }
941225
public function logException($e) {
		if(!$this->isLogging())
			return;

		#PSRException with a given severity
		if($e instanceof PSRException) {
			$severity = $e->getseverity();
			$msg = $e->getMessage();
		}
		#PHP exception
		elseif($e instanceof \ErrorException) {
			$severity = static::getPHPErrorSeverity($e->getCode());
			$msg = 'PHP ('.static::getPHPError($e->getCode()).'): '.$e->getMessage();
		}
		#other exception
		else {
			$severity = \Psr\Log\LogLevel::ERROR;
			$msg = get_class($e).': '.$e->getMessage();
		}

		$trace = $this->getBacktraceFromException($e);

		$this->log($severity, $msg, $e->getFile(), $e->getLine(), $e, $trace);
	}
546032
private static function hasPDOException(\Exception $exception)
    {
        if ($exception instanceof \PDOException) {
            return true;
        }
        if ($exception->getPrevious() === null) {
            return false;
        }
        return self::hasPDOException($exception->getPrevious());
    }
51082
public function report( Exception $e )
	{
		if ( !$this->shouldReport( $e ) )
			return;

		try
		{
			$logger = Framework::log();
		}
		catch ( Exception $ex )
		{
			throw $e; // throw the original Exception
		}

		$logger->error( $e );


		$level = $this->getLevel( $e );
		$id = UniversalBuilder::resolveClass( ExceptionIdentifier::class )->identify( $e );

		$logger->{$level}( $e, ['identification' => ['id' => $id]] );
	}
960404
public function logCriticalException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->critical($e->__toString());
        }
    }
201639
protected function isExceptionRecoverable($e)
	{
		if ($e instanceof \ErrorException)
		{
			$ignore = E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_STRICT;
			return (($ignore & $e->getSeverity()) != 0);
		}

		return false;
	}
1274331
protected function shouldntReport(Exception $e)
    {
        return !is_null(collect($this->dontReport)->first(function ($type) use ($e) {
            return $e instanceof $type;
        }));
    }