diff options
author | michajlo <michajlo@google.com> | 2018-02-27 20:36:18 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-27 20:38:17 -0800 |
commit | 43fd34062f3e1a4eae57209e80aefadf00c1ade6 (patch) | |
tree | 24440b5aa1d2cefa655ce481bf6d6b9a2cb94944 /src/main/java | |
parent | 769d0a93bfb8628e88c16f0b942c8aa9c1534907 (diff) |
Replace PackageDeserializationException with SerializationException
PiperOrigin-RevId: 187273881
Diffstat (limited to 'src/main/java')
3 files changed, 3 insertions, 34 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java index 1ea10871b2..04307006fd 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Package.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java @@ -1601,8 +1601,6 @@ public class Package { PackageCodecDependencies codecDeps = context.getDependency(PackageCodecDependencies.class); try { return codecDeps.getPackageDeserializer().deserialize(context, codedIn); - } catch (PackageDeserializationException e) { - throw new SerializationException("Failed to deserialize Package", e); } catch (InterruptedException e) { throw new IllegalStateException( "Unexpected InterruptedException during Package deserialization", e); diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializationException.java b/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializationException.java deleted file mode 100644 index 992c2aba28..0000000000 --- a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializationException.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2018 The Bazel Authors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package com.google.devtools.build.lib.packages; - -/** Exception thrown when something goes wrong during package deserialization. */ -public class PackageDeserializationException extends Exception { - PackageDeserializationException(String message) { - super(message); - } - - PackageDeserializationException(String message, Exception reason) { - super(message, reason); - } - - PackageDeserializationException(Exception reason) { - super(reason); - } -} diff --git a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializerInterface.java b/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializerInterface.java index afdfac048a..9902817c06 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializerInterface.java +++ b/src/main/java/com/google/devtools/build/lib/packages/PackageDeserializerInterface.java @@ -15,6 +15,7 @@ package com.google.devtools.build.lib.packages; import com.google.devtools.build.lib.skyframe.serialization.DeserializationContext; +import com.google.devtools.build.lib.skyframe.serialization.SerializationException; import com.google.protobuf.CodedInputStream; import java.io.IOException; @@ -31,10 +32,10 @@ public interface PackageDeserializerInterface { * * @param codedIn stream to read from * @return a new {@link Package} as read from {@code codedIn} - * @throws PackageDeserializationException on failures deserializing the input * @throws IOException on failures reading from {@code codedIn} * @throws InterruptedException + * @throws SerializationException on failures deserializing the input */ Package deserialize(DeserializationContext context, CodedInputStream codedIn) - throws PackageDeserializationException, IOException, InterruptedException; + throws IOException, InterruptedException, SerializationException; } |