diff --git a/overviewer.py b/overviewer.py index 612f1c9..0b0f6fe 100755 --- a/overviewer.py +++ b/overviewer.py @@ -503,6 +503,10 @@ if __name__ == "__main__": try: ret = main() util.nice_exit(ret) + except textures.TextureException, e: + # this isn't a "bug", so don't print scary traceback + logging.error(str(e)) + util.nice_exit(1) except Exception, e: logging.exception("""An error has occurred. This may be a bug. Please let us know! See http://docs.overviewer.org/en/latest/index.html#help diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 5b3f2a4..b3b4b9e 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -29,6 +29,11 @@ import functools import util from c_overviewer import alpha_over +class TextureException(Exception): + "To be thrown when a texture is not found." + pass + + ## ## Textures object ## @@ -213,7 +218,7 @@ class Textures(object): if verbose: logging.info("Found %s in '%s'", filename, path) return open(path, mode) - raise IOError("Could not find the file `{0}'. Try specifying the 'texturepath' option in your config file. Set it to the directory where I can find {0}. Also see ".format(filename)) + raise TextureException("Could not find the file `{0}'. Try specifying the 'texturepath' option in your config file. Set it to the directory where I can find {0}. Also see ".format(filename)) def load_image(self, filename): """Returns an image object"""