Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8393508
exceptions.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
707 B
Subscribers
None
exceptions.py
View Options
# Copyright (C) 2020 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from
typing
import
Any
,
Optional
class
InvalidObjectType
(
TypeError
):
pass
class
InvalidDirectoryPath
(
Exception
):
pass
class
LargePayloadExc
(
Exception
):
pass
class
DBError
(
Exception
):
pass
class
APIError
(
Exception
):
def
__str__
(
self
):
return
'"
%s
"'
%
self
.
args
def
error_response
(
reason
:
Optional
[
Any
],
status_code
:
int
,
api_url
:
str
):
error_msg
=
f
"{status_code} {reason}: '{api_url}'"
raise
APIError
(
error_msg
)
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Wed, Jun 4, 7:14 PM (5 d, 4 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3240047
Attached To
rDTSCN Code scanner
Event Timeline
Log In to Comment