response_code = $response_code; } public static function formException(Exception $e, $response_code = 400000) { return new ApiException($e->getMessage(), $response_code, $e); } /** * @return int */ public function getResponseCode() { return $this->response_code; } /** * @return JsonResponse */ public function render(): JsonResponse { return new JsonResponse([ 'message' => $this->getMessage(), 'code' => $this->getResponseCode(), 'data' => new \stdClass(), ]); } }