handling errors thrown in resolver function