Skip to content

Commit 3421046

Browse files
Resolves #257 (#294)
Signed-off-by: Mudit Chaudhary <chmudit@amazon.com>
1 parent be7971c commit 3421046

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CedarJava/src/main/java/com/cedarpolicy/model/AuthorizationSuccessResponse.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,19 @@ public AuthorizationError(
116116
this.policyId = policyId;
117117
this.error = error;
118118
}
119+
120+
public String getPolicyId() {
121+
return this.policyId;
122+
}
123+
124+
public DetailedError getError() {
125+
return this.error;
126+
}
127+
128+
@Override
129+
public String toString() {
130+
return String.format("AuthorizationError{policyId=%s, error=%s}", policyId, error);
131+
}
119132
}
120133

121134
/** Result of request evaluation. */

CedarJava/src/main/java/com/cedarpolicy/model/DetailedError.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,18 @@ public SourceLabel(
105105
this.start = start;
106106
this.end = end;
107107
}
108+
109+
@Override
110+
public String toString() {
111+
return String.format("SourceLabel{label=\"%s\", start=%s, end=%s}", label.orElse(""), start, end);
112+
}
113+
}
114+
115+
@Override
116+
public String toString() {
117+
return String.format(
118+
"DetailedError{message=\"%s\", help=\"%s\", code=\"%s\", url=\"%s\", severity=%s, sourcelocations=%s, related=%s}",
119+
message, help.orElse(""), code.orElse(""), url.orElse(""), severity.map(Severity::toString).orElse(""),
120+
sourceLocations, related);
108121
}
109122
}

0 commit comments

Comments
 (0)