-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alireza Davoudian
committed
Dec 15, 2023
1 parent
96b3229
commit 8482899
Showing
3 changed files
with
46 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
class ResolveError(ValueError): | ||
pass | ||
def __init__(self, message, http_response_code=None): | ||
super().__init__(message) | ||
self.http_response_code = http_response_code | ||
|
||
class RepoError(Exception): | ||
pass | ||
class RepoError(ValueError): | ||
def __init__(self, message, url, supported_urls=None, http_response_code=None): | ||
super().__init__(message) | ||
self.url = url | ||
self.supported_urls = supported_urls or ["dataverse.harvard.edu", "dataverse.no", "snd.se/catalogue", "su.figshare.com", "figshare.scilifelab.se", "zenodo.org"] | ||
self.http_response_code = http_response_code | ||
|
||
if url not in self.supported_urls: | ||
raise self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters