Skip to content

Commit a08cd84

Browse files
committed
catch errors from decoding in the already throwing code
1 parent a955bf8 commit a08cd84

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

x-pack/plugins/snapshot_restore/public/application/lib/attempt_to_uri_decode.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ export const attemptToURIDecode = (value: string) => {
1010
try {
1111
result = decodeURI(value);
1212
result = decodeURIComponent(result);
13-
} catch (e) {
14-
result = decodeURIComponent(value);
13+
} catch (e1) {
14+
try {
15+
result = decodeURIComponent(value);
16+
} catch (e2) {
17+
result = value;
18+
}
1519
}
1620

1721
return result;

0 commit comments

Comments
 (0)