Search code examples
unit-testinggoogle-app-enginewebtest

Simulate server error


I use the App Engine for run my application and want to test how it will handle server errors. Is there any possibility to simulate an error 500 via the WebTest ?


Solution

  • A 500 error is just what your webapp returns to the client when it gets an uncaught exception. It's not a specific failure - just what it shows to your users when something unexpected goes wrong. Instead, you should unit-test your handlers to ensure they act as expected.