Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
2a4affef
Commit
2a4affef
authored
Jan 11, 2018
by
Greg Messner
Browse files
Simplified exception handling and logging of same.
parent
988f71cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/systemhooks/SystemHookManager.java
View file @
2a4affef
package
org.gitlab4j.api.systemhooks
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.util.List
;
import
java.util.concurrent.CopyOnWriteArrayList
;
...
...
@@ -15,9 +14,6 @@ import org.gitlab4j.api.HookManager;
import
org.gitlab4j.api.utils.HttpRequestUtils
;
import
org.gitlab4j.api.utils.JacksonJson
;
import
com.fasterxml.jackson.core.JsonParseException
;
import
com.fasterxml.jackson.databind.JsonMappingException
;
/**
* This class provides a handler for processing GitLab System Hook callouts.
*/
...
...
@@ -71,7 +67,6 @@ public class SystemHookManager extends HookManager {
throw
new
GitLabApiException
(
message
);
}
String
errorMessage
=
null
;
try
{
SystemHookEvent
event
;
...
...
@@ -88,22 +83,11 @@ public class SystemHookManager extends HookManager {
fireEvent
(
event
);
}
catch
(
JsonParseException
jpe
)
{
errorMessage
=
jpe
.
getMessage
();
LOG
.
warning
(
"Error parsing JSON data, error="
+
errorMessage
);
}
catch
(
JsonMappingException
jme
)
{
errorMessage
=
jme
.
getMessage
();
LOG
.
warning
(
"Error mapping JSON data, error="
+
errorMessage
);
}
catch
(
IOException
ioe
)
{
errorMessage
=
ioe
.
getMessage
();
LOG
.
warning
(
"Error reading JSON data, error="
+
errorMessage
);
}
catch
(
Exception
e
)
{
errorMessage
=
e
.
getMessage
();
LOG
.
warning
(
"Unexpected error reading JSON data, error="
+
errorMessage
);
LOG
.
warning
(
"Error processing JSON data, exception="
+
e
.
getClass
().
getSimpleName
()
+
", error="
+
e
.
getMessage
());
throw
new
GitLabApiException
(
e
);
}
if
(
errorMessage
!=
null
)
throw
new
GitLabApiException
(
errorMessage
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment