catch error in view