Skip to content

Commit

Permalink
Merge branch 'master' of github.com:NYUCCL/psiTurk
Browse files Browse the repository at this point in the history
  • Loading branch information
deargle committed Mar 23, 2021
2 parents db83b6a + f62b8f7 commit e728133
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ thought through.
call `render_template()` on it yourself.
- psiturk.js `preloadPages()` now returns a `Promise`. See the [migration guide](https://psiturk.readthedocs.io/en/latest/migrating.html) for links to
examples of using the new approach.
- psiturk exception `InvalidUsage` changed to `InvalidUsageError`. Breaks
`custom.py` files generated under psiturk v2.

#### Configuration files
- the configuration file created by running `psiturk-setup-example`
Expand Down
9 changes: 7 additions & 2 deletions psiturk/experiment_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def error_page(self, request, contact_on_error):


class ExperimentApiError(Exception):

def __init__(self, message, status_code=500, payload=None):
super().__init__()
self.message = message
Expand All @@ -168,8 +168,13 @@ def to_dict(self):


class InvalidUsageError(ExperimentApiError):

def __init__(self, *args, **kwargs):
if 'status_code' not in kwargs:
kwargs['status_code'] = 400
super(InvalidUsageError, self).__init__(*args, **kwargs)

class InvalidUsage(InvalidUsageError):
# backwards compatibility with psiturk v2's custom.py files
# generated by psiturk-setup-example
pass

0 comments on commit e728133

Please sign in to comment.