Skip to content

Commit

Permalink
Change error type
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgianaElena committed Apr 7, 2023
1 parent 17a5b84 commit 4982efc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions binderhub/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from tornado.iostream import StreamClosedError
from tornado.log import app_log
from tornado.queues import Queue
from tornado.web import Finish, authenticated
from tornado.web import Finish, authenticated, HTTPError

from .base import BaseHandler
from .build import ProgressEvent
Expand Down Expand Up @@ -413,13 +413,13 @@ async def get(self, provider_prefix, _unescaped_spec):
if not require_build_only:
build_only_query_parameter = self.get_query_argument(name="build_only", default="")
if build_only_query_parameter.lower() == "true":
raise ValueError("Building but not launching is not permitted!")
raise HTTPError(log_message="Building but not launching is not permitted!")
else:
# Not setting a default will make the function raise an error
# if the `build_only` query parameter is missing from the request
build_only_query_parameter = self.get_query_argument(name="build_only")
if build_only_query_parameter.lower() != "true":
raise ValueError("The `build_only=true` query parameter is required!")
raise HTTPError(log_message="The `build_only=true` query parameter is required!")
# If we're here, it means a build only deployment is required
build_only = True

Expand Down

0 comments on commit 4982efc

Please sign in to comment.