[pixiv] raise NotFoundError instead of failing

This commit is contained in:
Mike Fährmann
2016-08-28 16:21:51 +02:00
parent 687478f6f6
commit effa1084f2
2 changed files with 11 additions and 4 deletions

View File

@@ -123,12 +123,16 @@ def main():
except exception.AuthenticationError:
print("Authentication failed. Please provide a valid "
"username/password pair.", file=sys.stderr)
except exception.NotFoundError as err:
res = str(err) or "resource (gallery/image/user)"
print("The ", res, " at '", url, "' does not exist",
sep="", file=sys.stderr)
except KeyboardInterrupt:
print("\nKeyboardInterrupt", file=sys.stderr)
except BrokenPipeError:
pass
except IOError as e:
except IOError as err:
import errno
if e.errno != errno.EPIPE:
if err.errno != errno.EPIPE:
raise