Skip to content
This repository was archived by the owner on May 14, 2020. It is now read-only.
This repository was archived by the owner on May 14, 2020. It is now read-only.

Error code and class mapping #1

@danielqiu

Description

@danielqiu

In the rest-servlet.xml, you map each status code to a class:

<entry key="com.stormpath.blog.spring.mvc.rest.exhandler.UnknownResourceException" 
value="404, _exmsg"/>

In my app, I want to have a specific and unique error code for each error, for example,
1000, Error while inserting user with duplicated key
1001, Error while deleting user,
...
I might have hundreds or more for all the possible errors as the app grows. Or let's say we need to implement all the codes from http://www.twilio.com/docs/errors/reference and some other customized codes.

Do I need to create a class, like UnknownResourceException, for each of this? That would be tons of classes/files. Otherwise how can I create a couple of classes but serve all these errors in some way? If so how could I do that? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions