Skip to content

Commit 1bf497e

Browse files
committed
chore: move MaxRedirectsExceededException out of BlobDescriptorStream
1 parent bc7a931 commit 1bf497e

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

google-cloud-storage/src/main/java/com/google/cloud/storage/BlobDescriptorStream.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -527,12 +527,4 @@ static BlobDescriptorStream create(
527527
int maxRedirectsAllowed = 3; // TODO: make this configurable in the ultimate public surface
528528
return new BlobDescriptorStream(state, executor, callable, maxRedirectsAllowed, retryContext);
529529
}
530-
531-
static final class MaxRedirectsExceededException extends RuntimeException {
532-
private MaxRedirectsExceededException(int maxRedirectAllowed, int actualRedirects) {
533-
super(
534-
String.format(
535-
"max redirects exceeded (max: %d, actual: %d)", maxRedirectAllowed, actualRedirects));
536-
}
537-
}
538530
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright 2024 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.google.cloud.storage;
18+
19+
final class MaxRedirectsExceededException extends RuntimeException {
20+
21+
MaxRedirectsExceededException(int maxRedirectAllowed, int actualRedirects) {
22+
super(
23+
String.format(
24+
"max redirects exceeded (actual: %d, max: %d)", actualRedirects, maxRedirectAllowed));
25+
}
26+
}

0 commit comments

Comments
 (0)