FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-experiments/error_message_class.py at main · zaplapl/python-experiments · GitHub
zaplapl
/
python-experiments
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-experiments
/
error_message_class.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (13 loc) · 687 Bytes
Breadcrumbs
python-experiments
/
error_message_class.py
Copy path
File metadata and controls
17 lines (13 loc) · 687 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class
ErrorMessage
:
base_error_message
=
{
"error_code"
:
""
,
"error_message"
: {},
"details"
: {}}
def
__init__
(
self
,
attribute
,
*
args
):
# set error code here
return
getattr
(
self
,
attribute
)(
*
args
)
def
simple_message
(
self
,
args
):
self
.
base_error_message
[
"error_message"
]
=
"simple error message"
return
self
.
base_error_message
def
complex_message
(
self
,
one_thing
,
another_thing
):
self
.
base_error_message
[
"error_message"
]
=
"complex error message"
self
.
base_error_message
[
"details"
][
"one_thing"
]
=
one_thing
self
.
base_error_message
[
"details"
][
"another_thing"
]
=
another_thing
return
self
.
base_error_message
Back
|
FazBrowse Home
|
New Git URL