/home/techb158/public_html/wp-content/plugins/kirki/libraries/framework
Edit: /home/techb158/public_html/wp-content/plugins/kirki/libraries/framework/ApiExceptionHandler.php (2127B)
$exception->getMessage(), 'errors' => $exception->get_errors()];
return response()->json($response, Response::UNPROCESSABLE_ENTITY);
}
if ($exception instanceof ModelNotFoundException) {
$response = ['message' => $exception->getMessage()];
return response()->json($response, Response::NOT_FOUND);
}
return static::fallback_response($exception);
}
/**
* Get the fallback response for the exception.
*
* @param Exception $exception The exception to get the fallback response for.
*
* @return Response The fallback response for the exception.
*
* @since 1.0.0
*/
protected static function fallback_response(Exception $exception)
{
$status_code = (int) $exception->getCode();
if ($status_code < 100 || $status_code > 599) {
$status_code = Response::INTERNAL_SERVER_ERROR;
// fallback to 500
}
$response = ['message' => $exception->getMessage()];
return response()->json($response, $status_code);
}
}