• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to catch error code?

 
Nakata kokuyo
Ranch Hand
Posts: 472
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day,

When the web application running fine we will get the return of status code - 200, for "Internal Error" we get status code "500".

I know we will use try catch to deal with the exception, but may i know what the java API name the "500" and also "Internal error"? is this called throwable?

I need to create an exception handling to provide more meaning of exception that being catch, like "Internal error" , could modify to "System unstable, please retry again in 30mins time".

any sample on above exception handling?

Thanks for guidance !
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65522
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be declaring an error handler in the web.xml.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nakata kokuyo wrote:
any sample on above exception handling?
!


A quick google search gave me this page at first.

http://www.onehippo.org/library/concepts/error-pages-and-error-handling/1.-handling-error-codes-and-exceptions-by-the-web.xml.html
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!