-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from cloudblue/LITE-28139_Add_capability_to_va…
…lidate_PPR_file_using_CBC_PLM_API LITE-28139 Add capability to validate/parse PPR file using CBC PLM API
- Loading branch information
Showing
8 changed files
with
877 additions
and
7 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,15 +1,20 @@ | ||
from json import JSONDecodeError | ||
|
||
from requests import Response | ||
|
||
|
||
class ClientError(RuntimeError): | ||
def __init__( | ||
self, | ||
message: str, | ||
status_code: int = None, | ||
response: Response = None, | ||
cause: Exception = None, | ||
): | ||
self.message = message | ||
self.response = response | ||
self.status_code = status_code | ||
self.status_code = response.status_code if response else None | ||
self.cause = cause | ||
try: | ||
self.json = response.json() if response else None | ||
except JSONDecodeError: | ||
self.json = None |
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
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
Binary file not shown.
Oops, something went wrong.