mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-28 15:45:04 +08:00
improve exception handle
This commit is contained in:
@@ -79,10 +79,10 @@ public class TicketQuery extends HttpServlet {
|
||||
return new Response(Response.ResponseCode.ILLEGAL_PARAMETER);
|
||||
} catch (HibernateException e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR, e);
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e);
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -79,10 +79,10 @@ public class TicketSubmit extends HttpServlet {
|
||||
return new Response(Response.ResponseCode.ILLEGAL_PARAMETER);
|
||||
} catch (HibernateException e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR);
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e);
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ public class TicketUpdate extends HttpServlet {
|
||||
return new Response(Response.ResponseCode.ILLEGAL_PARAMETER);
|
||||
} catch (HibernateException e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR, e);
|
||||
return new Response(Response.ResponseCode.DATABASE_ERROR, e.getMessage());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e);
|
||||
return new Response(Response.ResponseCode.INTERNAL_ERROR, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user