Skip to content

Commit

Permalink
ApiException that ignores 404 so we filter out spurious app not found…
Browse files Browse the repository at this point in the history
… errors. This might filter out legitimate errors if we have a request to a bad endpoint.
  • Loading branch information
jesseshieh committed Nov 14, 2020
1 parent a259181 commit 81ca7be
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions gigalixir/api_exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class ApiException(Exception):
def __init__(self, response):
if response.status_code == 404:
self._rollbar_ignore = True
message = response.text
super(ApiException, self).__init__(message)
3 changes: 2 additions & 1 deletion gigalixir/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import click
from .shell import cast, call
from . import auth
from . import api_exception
from . import presenter
from . import ssh_key
from . import git
Expand Down Expand Up @@ -81,7 +82,7 @@ def status(host, app_name):
if r.status_code != 200:
if r.status_code == 401:
raise auth.AuthException()
raise Exception(r.text)
raise api_exception.ApiException(r)
else:
data = json.loads(r.text)["data"]
presenter.echo_json(data)
Expand Down

0 comments on commit 81ca7be

Please sign in to comment.