Replace RuntimeException
with IllegalStateException
.
Refactor to replace instances of `RuntimeException` with `IllegalStateException`. This change ensures exceptions can be handled more specifically without unintended catches of unrelated exceptions. PiperOrigin-RevId: 658337459
This commit is contained in:
parent
f3bf4ad5fe
commit
01593a9c1f
@ -380,7 +380,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating VP9 extension", e);
|
||||
throw new IllegalStateException("Error instantiating VP9 extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -405,7 +405,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating AV1 extension", e);
|
||||
throw new IllegalStateException("Error instantiating AV1 extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -431,7 +431,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating FFmpeg extension", e);
|
||||
throw new IllegalStateException("Error instantiating FFmpeg extension", e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -488,7 +488,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating MIDI extension", e);
|
||||
throw new IllegalStateException("Error instantiating MIDI extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -507,7 +507,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating Opus extension", e);
|
||||
throw new IllegalStateException("Error instantiating Opus extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -526,7 +526,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating FLAC extension", e);
|
||||
throw new IllegalStateException("Error instantiating FLAC extension", e);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -545,7 +545,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating FFmpeg extension", e);
|
||||
throw new IllegalStateException("Error instantiating FFmpeg extension", e);
|
||||
}
|
||||
try {
|
||||
// Full class names used for constructor args so the LINT rule triggers if any of them move.
|
||||
@ -562,7 +562,7 @@ public class DefaultRenderersFactory implements RenderersFactory {
|
||||
// Expected if the app was built without the extension.
|
||||
} catch (Exception e) {
|
||||
// The extension is present, but instantiation failed.
|
||||
throw new RuntimeException("Error instantiating IAMF extension", e);
|
||||
throw new IllegalStateException("Error instantiating IAMF extension", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user