From 00fd57264e823795da55791128596dd97181d48a Mon Sep 17 00:00:00 2001 From: Okada Shohei Date: Mon, 18 Mar 2019 08:31:26 +0900 Subject: [PATCH] =?UTF-8?q?=E5=85=B7=E8=B1=A1=E7=8B=AC=E8=87=AA=E4=BE=8B?= =?UTF-8?q?=E5=A4=96=20ServerErrorExeption=20=E3=82=92=E5=AE=9A=E7=BE=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/Exceptions/ServerErrorException.php | 54 +++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/app/Exceptions/ServerErrorException.php diff --git a/src/app/Exceptions/ServerErrorException.php b/src/app/Exceptions/ServerErrorException.php new file mode 100644 index 0000000..cc9d4c8 --- /dev/null +++ b/src/app/Exceptions/ServerErrorException.php @@ -0,0 +1,54 @@ +context = $context; + } + + /** + * @return array ログ出力時の追加情報 + */ + public function getContext(): array + { + return $this->context; + } + + /** + * @return int HTTP ステータスコード + */ + public function getStatusCode(): int + { + return 500; + } + + /** + * @return string ユーザ向けのメッセージ + */ + public function getUserMessage(): string + { + return 'サーバエラーが発生しました。もう一度同じ操作をお試しください。問題が解消しない場合は、お問い合わせ窓口よりご報告をお願いいたします。'; + } +}