1
1
2
2
package org .gitlab4j .api .systemhooks ;
3
3
4
- import java .io .IOException ;
5
4
import java .io .InputStreamReader ;
6
5
import java .util .List ;
7
6
import java .util .concurrent .CopyOnWriteArrayList ;
15
14
import org .gitlab4j .api .utils .HttpRequestUtils ;
16
15
import org .gitlab4j .api .utils .JacksonJson ;
17
16
18
- import com .fasterxml .jackson .core .JsonParseException ;
19
- import com .fasterxml .jackson .databind .JsonMappingException ;
20
-
21
17
/**
22
18
* This class provides a handler for processing GitLab System Hook callouts.
23
19
*/
@@ -71,7 +67,6 @@ public void handleEvent(HttpServletRequest request) throws GitLabApiException {
71
67
throw new GitLabApiException (message );
72
68
}
73
69
74
- String errorMessage = null ;
75
70
try {
76
71
77
72
SystemHookEvent event ;
@@ -88,22 +83,11 @@ public void handleEvent(HttpServletRequest request) throws GitLabApiException {
88
83
89
84
fireEvent (event );
90
85
91
- } catch (JsonParseException jpe ) {
92
- errorMessage = jpe .getMessage ();
93
- LOG .warning ("Error parsing JSON data, error=" + errorMessage );
94
- } catch (JsonMappingException jme ) {
95
- errorMessage = jme .getMessage ();
96
- LOG .warning ("Error mapping JSON data, error=" + errorMessage );
97
- } catch (IOException ioe ) {
98
- errorMessage = ioe .getMessage ();
99
- LOG .warning ("Error reading JSON data, error=" + errorMessage );
100
86
} catch (Exception e ) {
101
- errorMessage = e .getMessage ();
102
- LOG .warning ("Unexpected error reading JSON data, error=" + errorMessage );
87
+ LOG .warning ("Error processing JSON data, exception=" +
88
+ e .getClass ().getSimpleName () + ", error=" + e .getMessage ());
89
+ throw new GitLabApiException (e );
103
90
}
104
-
105
- if (errorMessage != null )
106
- throw new GitLabApiException (errorMessage );
107
91
}
108
92
109
93
/**
0 commit comments