source: tapas/web/src/com/ether/WebException.java @ 416

Last change on this file since 416 was 416, checked in by vmipsl, 12 years ago

User : ajout laboratoire & pays
BO : idem
Création compte : idem
DataProtocole?
Clean accent properties
Language

File size: 1.4 KB
Line 
1package com.ether;
2
3/**
4 * @author vmipsl
5 * @date 02 feb 2011
6 */
7public class WebException
8        extends FormattedException
9{
10    public WebException( final Enum<? extends Code> code )
11    {
12        super( code );
13    }
14
15    public WebException( final Throwable throwable )
16    {
17        super( throwable );
18    }
19
20    public WebException( final Enum<? extends Code> code, final Throwable throwable, final Object... parameters )
21    {
22        this( code, throwable.getMessage(), throwable, parameters );
23    }
24
25    public WebException( final Enum<? extends Code> code, final String message, final Object... parameters )
26    {
27        super( code, message, DEFAULT_THROWABLE, parameters );
28    }
29
30    protected WebException( final Enum<? extends Code> code, final String message, final Throwable throwable, final Object... parameters )
31    {
32        super( formatThrowable( code, message, throwable ), throwable, parameters );
33    }
34
35    public static enum WebCode
36            implements Code
37    {
38        IO_EXCEPTION_ERROR_TO_GET_OUTPUTSTREAM,
39        ERROR_TO_DOWNLOAD_FILE,
40        ERROR_UNSUPPORTED_UTF8_ENCODING,
41        ERROR_NO_REQUEST_HANDLING_METHOD,
42        ERROR_NUMBER_OF_PARAM_TYPES_NOT_EQUAL_TO_PARAM_ANNOTATIONS,
43        ERROR_JSON_TAPAS_IS_NULL,
44        USER_ALREADY_EXISTS,
45        ERROR_ENCRYPT_PASSWORD,
46        ERROR_EMAIL_CANNOT_BE_SEND
47    }
48
49    private static final Throwable DEFAULT_THROWABLE = null;
50}
Note: See TracBrowser for help on using the repository browser.