add raise errors middleware

Use SCREAMING_SNAKE_CASE for constants.