refine error handling for react and dreact