For error it's between 400 and 599. We could add a test on that and set it to 500 if it's outside those bounds.

But isn't it the task of other listeners or classes to set the appropriate error code ?