what is the best practice to pass backend error msg to front end

Viewed 26

recently I was working in a project both needs backend and front end, sometimes, there could be a error msg in several callback depth,

Say I use java as my backend server, and here is the call hierarchy

XXXController -> xxxService -> XXXDaoImpl (where exception happened)

I want to pass back the detailed error to controller so this can be displayed in front end side. Is there a elegant way to do this?

0 Answers
Related