0
スクリプトがあり、時には500 Internal Server Error
が発生します。私はそのエラーを処理することができます。しかし、これが起こったとき、答えにはどのようなステータスを使うべきですか?使用するステータスコードはどれですか?
コード例は:
# catch error
eval {
here is code which sometimes cause 500
....
$response_body = handle_request();
}
# Check if error occur
if([email protected]) {
$response_body = 'Error was handled';
# Should I change status from 500?
# If I should change. Which status I should use?
# 200 or something else?
}
return $response_body;
5xxはどれですか? –
ちょうど500、私は –
500とは思わないと思います。私は扱いと区別しなければならない。たとえば、599を使用するとします。しかし、助言を求める前に尋ねる。 –