kopia lustrzana https://github.com/gaul/s3proxy
Ensure S3Exception has message
Also add missing toString implementation.pull/176/merge
rodzic
34c36e4236
commit
3d9a7120ce
|
@ -44,7 +44,7 @@ public final class S3Exception extends Exception {
|
|||
|
||||
S3Exception(S3ErrorCode error, String message, Throwable cause,
|
||||
Map<String, String> elements) {
|
||||
super(message, cause);
|
||||
super(requireNonNull(message), cause);
|
||||
this.error = requireNonNull(error);
|
||||
this.elements = ImmutableMap.copyOf(elements);
|
||||
}
|
||||
|
@ -56,4 +56,9 @@ public final class S3Exception extends Exception {
|
|||
Map<String, String> getElements() {
|
||||
return elements;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return error + " " + elements;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1079,7 +1079,8 @@ public class S3ProxyHandler {
|
|||
}
|
||||
if (!created) {
|
||||
throw new S3Exception(S3ErrorCode.BUCKET_ALREADY_OWNED_BY_YOU,
|
||||
null, null, ImmutableMap.of("BucketName", containerName));
|
||||
S3ErrorCode.BUCKET_ALREADY_OWNED_BY_YOU.getMessage(),
|
||||
null, ImmutableMap.of("BucketName", containerName));
|
||||
}
|
||||
|
||||
response.addHeader(HttpHeaders.LOCATION, "/" + containerName);
|
||||
|
|
Ładowanie…
Reference in New Issue