Skip to content

Commit 9bb2d57

Browse files
committed
Update consolidated snippets
1 parent 042809b commit 9bb2d57

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

public/consolidated/python.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,19 @@
101101
{
102102
"categoryName": "Error Handling",
103103
"snippets": [
104+
{
105+
"title": "Create Custom Exception Type",
106+
"description": "Create a Custom Exception Type that can be called with raise.",
107+
"author": "mrcool7387",
108+
"tags": [
109+
"python",
110+
"error-creation",
111+
"organisation",
112+
"utility"
113+
],
114+
"contributors": [],
115+
"code": "class ExceptionName(BaseException):\n def __init__(message: str):\n super().__init__(message)\n\n# Usage\na: int = 1\n\nif a > 0:\n raise ExceptionName('Error Message')\n"
116+
},
104117
{
105118
"title": "Handle File Not Found Error",
106119
"description": "Attempts to open a file and handles the case where the file does not exist.",

0 commit comments

Comments
 (0)