11
22package org .gitlab4j .api .systemhooks ;
33
4- import java .io .IOException ;
54import java .io .InputStreamReader ;
65import java .util .List ;
76import java .util .concurrent .CopyOnWriteArrayList ;
1514import org .gitlab4j .api .utils .HttpRequestUtils ;
1615import org .gitlab4j .api .utils .JacksonJson ;
1716
18- import com .fasterxml .jackson .core .JsonParseException ;
19- import com .fasterxml .jackson .databind .JsonMappingException ;
20-
2117/**
2218 * This class provides a handler for processing GitLab System Hook callouts.
2319 */
@@ -71,7 +67,6 @@ public void handleEvent(HttpServletRequest request) throws GitLabApiException {
7167 throw new GitLabApiException (message );
7268 }
7369
74- String errorMessage = null ;
7570 try {
7671
7772 SystemHookEvent event ;
@@ -88,22 +83,11 @@ public void handleEvent(HttpServletRequest request) throws GitLabApiException {
8883
8984 fireEvent (event );
9085
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 );
10086 } 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 );
10390 }
104-
105- if (errorMessage != null )
106- throw new GitLabApiException (errorMessage );
10791 }
10892
10993 /**
0 commit comments