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
0c2c14e9
Commit
0c2c14e9
authored
Mar 20, 2014
by
Greg Messner
Browse files
Fixed NPE.
parent
8750a1f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/messners/gitlab/api/GitLabApiException.java
View file @
0c2c14e9
...
...
@@ -12,6 +12,7 @@ public class GitLabApiException extends Exception {
private
String
message
;
/**
* Create a GitLabApiException based on the ClientResponse.
*
* @param response
*/
...
...
@@ -38,28 +39,34 @@ public class GitLabApiException extends Exception {
/**
* Get the message associated with the exception.
*
* @return the message associated with the exception
*/
@Override
public
final
String
getMessage
()
{
return
(
message
!=
null
?
message
:
statusInfo
.
getReason
Phrase
());
return
(
message
!=
null
?
message
:
getReason
());
}
/**
* Returns the HTTP status reason message, returns null if the
* causing error was not an HTTP related exception.
*
* @return
*/
public
final
String
getReason
()
{
return
(
statusInfo
.
getReasonPhrase
());
return
(
statusInfo
!=
null
?
statusInfo
.
getReasonPhrase
()
:
null
);
}
/**
*
* Returns the HTTP status code. returns 0 if the
* causing error was not an HTTP related exception.
*
* @return
*/
public
final
int
getHttpStatus
()
{
return
(
statusInfo
.
getStatusCode
());
return
(
statusInfo
!=
null
?
statusInfo
.
getStatusCode
()
:
0
);
}
}
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