Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.5] Default 404 and 500 error pages #18483

Merged
merged 5 commits into from
Mar 28, 2017
Merged

[5.5] Default 404 and 500 error pages #18483

merged 5 commits into from
Mar 28, 2017

Conversation

laurencei
Copy link
Contributor

@laurencei laurencei commented Mar 24, 2017

There is currently a nice "pretty" default 503 maintenance page included in the framework.

This PR adds similar "pretty" default 404 and 500 error pages (still can be easily overridden as required).

404s:

404

500s (when not in debug mode):

500

@dwightwatson
Copy link
Contributor

I wonder if it might be better to shorten the messages as much as possible, as this length of text won't look great on mobile devices. Maybe something like "Page not found" and "Something went wrong".

In addition, it might be beneficial to add a link back, or to the root URL. It's fair not to have that on a 503 page as one would expect the entire site to be unavailable, but with a 404 or a 500 you'll probably want to get the user back on the right track.

@ankurk91
Copy link
Contributor

What about having a fallback error.blade.php which can be loaded if corresponding view not found.

This way we will not have to create a separate view to each http error, it would be good if framework comes with this feature, later developers can override it.

@laurencei
Copy link
Contributor Author

laurencei commented Mar 27, 2017

@dwightwatson - I added some small padding. This is what they look like on a small mobile:

image

In regards to links etc - obviously it is up to Taylor (I can make further changes if required) - but my thinking is if you want links to your pages etc - that is where people can override and place what they like in their app.

Otherwise there is always the "back" button on a browser 😄

@taylorotwell
Copy link
Member

If we're gonna have smaller font sizes on these pages we should change the 503 page to match.

@laurencei
Copy link
Contributor Author

Ok - all font sizes now the same.

desktop

mobile

@JosephSilber
Copy link
Member

Why isn't there a single layout file that they all extend?

@laurencei
Copy link
Contributor Author

laurencei commented Mar 27, 2017

What happens if I make a layout file called errors.blade.php in the framework - and someone has the same layout file in their app? Might lead to unexpected behavior if you call a layout file you were not expecting?

I was trying to keep this simple - and let people override as they need...

@JosephSilber
Copy link
Member

@lioannou this would be in the errors directory, not a global layout file. So it won't clash with anything the user has elsewhere.

@laurencei
Copy link
Contributor Author

laurencei commented Mar 27, 2017

@JosephSilber - ok - I've done a refactor into a layout file.

I've used a layout filename that is unlikely to already be in use in someone's application (otherwise that will be called).

@taylorotwell
Copy link
Member

just call it errors::layout ... not errors:frameworkerror

@laurencei
Copy link
Contributor Author

@taylorotwell - ok done.

@fernandobandeira
Copy link
Contributor

Would it be possible to trans() these errors?
Just asking since we're changing them...

Personally I'll overwrite these pages however that might be usefull for the community...

@taylorotwell taylorotwell merged commit 330dbe7 into laravel:master Mar 28, 2017
@laurencei laurencei deleted the defaultErrorPages branch March 28, 2017 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants