Skip to content

Commit b1913e0

Browse files
author
Achim Brandt
committed
changed a return type
1 parent 0c129af commit b1913e0

File tree

1 file changed

+56
-56
lines changed

1 file changed

+56
-56
lines changed

src/main/java/com/arangodb/ArangoException.java

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,60 @@
2323
*
2424
*/
2525
public class ArangoException extends Exception {
26-
27-
protected BaseEntity entity;
28-
29-
public ArangoException() {
30-
super();
31-
}
32-
33-
public ArangoException(BaseEntity entity) {
34-
super((entity.getErrorNumber() == 0 ? "" : "[" + entity.getErrorNumber() + "]") + entity.getErrorMessage());
35-
this.entity = entity;
36-
}
37-
38-
public ArangoException(String message, Throwable cause) {
39-
super(message, cause);
40-
}
41-
42-
public ArangoException(String message) {
43-
super(message);
44-
}
45-
46-
public ArangoException(Throwable cause) {
47-
super(cause);
48-
}
49-
50-
public int getErrorNumber() {
51-
return (entity == null) ? 0 : entity.getErrorNumber();
52-
}
53-
54-
public int getCode() {
55-
return (entity == null) ? 0: entity.getCode();
56-
}
57-
58-
public String getErrorMessage() {
59-
return (entity == null) ? getMessage() : entity.getErrorMessage();
60-
}
61-
62-
public <T extends BaseEntity> T getEntity() {
63-
return (T) entity;
64-
}
65-
66-
public boolean isUnauthorized() {
67-
return (entity != null && entity.isUnauthorized());
68-
}
69-
70-
// public boolean isNotFound() {
71-
// return (entity != null && entity.isNotFound());
72-
// }
73-
74-
public void setCode(int code) {
75-
entity.setCode(code);
76-
}
77-
78-
public void setErrorNumber(int errorNumber) {
79-
entity.setErrorNumber(errorNumber);
80-
}
81-
26+
27+
protected BaseEntity entity;
28+
29+
public ArangoException() {
30+
super();
31+
}
32+
33+
public ArangoException(BaseEntity entity) {
34+
super((entity.getErrorNumber() == 0 ? "" : "[" + entity.getErrorNumber() + "]") + entity.getErrorMessage());
35+
this.entity = entity;
36+
}
37+
38+
public ArangoException(String message, Throwable cause) {
39+
super(message, cause);
40+
}
41+
42+
public ArangoException(String message) {
43+
super(message);
44+
}
45+
46+
public ArangoException(Throwable cause) {
47+
super(cause);
48+
}
49+
50+
public int getErrorNumber() {
51+
return (entity == null) ? 0 : entity.getErrorNumber();
52+
}
53+
54+
public int getCode() {
55+
return (entity == null) ? 0 : entity.getCode();
56+
}
57+
58+
public String getErrorMessage() {
59+
return (entity == null) ? getMessage() : entity.getErrorMessage();
60+
}
61+
62+
public BaseEntity getEntity() {
63+
return entity;
64+
}
65+
66+
public boolean isUnauthorized() {
67+
return (entity != null && entity.isUnauthorized());
68+
}
69+
70+
// public boolean isNotFound() {
71+
// return (entity != null && entity.isNotFound());
72+
// }
73+
74+
public void setCode(int code) {
75+
entity.setCode(code);
76+
}
77+
78+
public void setErrorNumber(int errorNumber) {
79+
entity.setErrorNumber(errorNumber);
80+
}
81+
8282
}

0 commit comments

Comments
 (0)