silverstripe / silverstripe-admin

Silverstripe Admin Component
BSD 3-Clause "New" or "Revised" License
25 stars 92 forks source link

ModelAdmin should fail gracefully when provided a non-sense modelclass #570

Open maxime-rainville opened 6 years ago

maxime-rainville commented 6 years ago

If you try to manage to access a ModelAdmin with a non-sensical model (e.g.: http://example.com/admin/my-model-admin/EditForm/field/Acme-Web-Some-Models-That-Doesnt-exists) you get some pretty scary 500 error.

This should return either a 400 or 404 error.

image

PRs

dhensby commented 6 years ago

I guess it's a 404.

The reason it's a 500 is because an error is triggered and that's somewhat helpful for users when debugging; I'm not sure we can set the error response code and maintain the error info, though?

maxime-rainville commented 6 years ago

While it is developer friendly, it's not very CMS-user friendly. The live version of the error is not very helpful either.

image

I think our entire CMS error page set up could be improved. Right now, the 404 error page in-cms just displays an unthemed version of the main error page.