diff --git a/src/brut/androlib/err/UndefinedResourceSpec.java b/src/brut/androlib/err/UndefinedResourceSpec.java new file mode 100644 index 00000000..7d68e963 --- /dev/null +++ b/src/brut/androlib/err/UndefinedResourceSpec.java @@ -0,0 +1,40 @@ +/* + * Copyright 2010 Ryszard Wiśniewski . + * + * 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. + * under the License. + */ + +package brut.androlib.err; + +import brut.androlib.AndrolibException; + +/** + * @author Ryszard Wiśniewski + */ +public class UndefinedResourceSpec extends AndrolibException { + public UndefinedResourceSpec(Throwable cause) { + super(cause); + } + + public UndefinedResourceSpec(String message, Throwable cause) { + super(message, cause); + } + + public UndefinedResourceSpec(String message) { + super(message); + } + + public UndefinedResourceSpec() { + } +} diff --git a/src/brut/androlib/res/data/ResPackage.java b/src/brut/androlib/res/data/ResPackage.java index a555c97a..84e31298 100644 --- a/src/brut/androlib/res/data/ResPackage.java +++ b/src/brut/androlib/res/data/ResPackage.java @@ -17,6 +17,7 @@ package brut.androlib.res.data; +import brut.androlib.err.UndefinedResourceSpec; import brut.androlib.AndrolibException; import brut.androlib.res.data.value.ResFileValue; import brut.androlib.res.data.value.ResValue; @@ -58,10 +59,10 @@ public class ResPackage { return mResSpecs.containsKey(resID); } - public ResResSpec getResSpec(ResID resID) throws AndrolibException { + public ResResSpec getResSpec(ResID resID) throws UndefinedResourceSpec { ResResSpec spec = mResSpecs.get(resID); if (spec == null) { - throw new AndrolibException("Undefined resource spec: " + resID); + throw new UndefinedResourceSpec(resID.toString()); } return spec; }