I have create custom error template into pub\errors\custom folder and Customize 503.phtml template file and write custom message into it.

In Site Default Mode and Production Mode Template File Working Well except developer mode.

So, can anyone tell me how to call my custom template file message in developer mode.

Thanks in advance...!

1 Answer 1


The decision to show a 503 page is done in \Magento\Framework\App\Http::catchException, specifically in method handleBootstrapErrors.

public function catchException(Bootstrap $bootstrap, \Exception $exception)
        $result = $this->handleDeveloperMode($bootstrap, $exception)
            || $this->handleBootstrapErrors($bootstrap, $exception)
            || $this->handleSessionException($exception)
            || $this->handleInitException($exception)
            || $this->handleGenericReport($bootstrap, $exception);
        return $result;

But if developer mode is enabled then handleDeveloperMode returs true so the others don't get executed.

If you just need to work on / design the 503 page then you can just add return false; at the beginning of handleDeveloperMode

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.