Service Unavailable HTTP Exception (503)

Is there a reason why Service Unavailable (code 503) is not present by default in Yii2? I think it would be quite useful because, for some reasons that would be too long to explain here, I need to stop the application for some daily housekeeping activities and, when somebody attempts to send a request to the API, I return a ServiceUnavailableHTTPException that I have added myself. It works fine, I just wanted to understand if there is a specific reason why it is not there by default.

Thank you! ;)

Possible it’s not included in the base templates would be that, if the website is down for maintenance, ‘$app’ should probably not run at all. In examples that I have seen, most post a file to the root directory. Then check for it’s presence in the index.php script and then abort running.

I can see your point about a 503 exception incase you had a sub part (module, controller, etc) that was down, then everything else could be up, but that specific area.

p.s. I’ve missed the HTTP Error 418 I’m a Teapot :lol: