add raise errors middleware

Space inside { missing.<br>Space inside } missing.