Add more detailed message to a 500 error

Closes #511
Review 1464 by @Tryneus