Skip to content

Commit

Permalink
Catch Reddit server errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dkozinn committed Apr 25, 2024
1 parent 10040ef commit a4478ea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pyrightconfig.json

#misc
local.notes
**/test*.py
#**/test*.py
**/approve*.py
.ignore
.vscode
2 changes: 1 addition & 1 deletion src/nasajobsbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main():
main()
except KeyboardInterrupt:
sys.exit(0)
except prawcore.exceptions.ServerError:
except (prawcore.exceptions.ServerError, prawcore.exceptions.ResponseException):
logging.exception("Reddit error")
sys.exit(2)
except praw.exceptions.RedditAPIException:
Expand Down
2 changes: 1 addition & 1 deletion src/nasamodqbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def main():
main()
except KeyboardInterrupt:
sys.exit(0)
except prawcore.exceptions.ServerError:
except (prawcore.exceptions.ServerError, prawcore.exceptions.ResponseException):
logging.exception("Reddit error")
sys.exit(2)
except Exception as error: # pylint: disable=broad-except
Expand Down
2 changes: 1 addition & 1 deletion src/nasapostbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def main():
main()
except KeyboardInterrupt:
sys.exit(0)
except prawcore.exceptions.ServerError:
except (prawcore.exceptions.ServerError, prawcore.exceptions.ResponseException):
logging.exception("Reddit error")
sys.exit(2)
except Exception as error: # pylint: disable=broad-except
Expand Down
2 changes: 1 addition & 1 deletion src/nasaxpost.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def main():
main()
except KeyboardInterrupt:
sys.exit(0)
except prawcore.exceptions.ServerError:
except (prawcore.exceptions.ServerError, prawcore.exceptions.ResponseException):
logging.exception("Reddit error")
sys.exit(2)
except Exception as error: # pylint: disable=broad-except
Expand Down

0 comments on commit a4478ea

Please sign in to comment.