Skip to content

Commit 0ee53d4

Browse files
committed
Remove general Exception raising
1 parent 9a46fde commit 0ee53d4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flask_mongoengine/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def __init__(self, app=None, config=None):
104104

105105
def init_app(self, app, config=None):
106106
if not app or not isinstance(app, Flask):
107-
raise Exception("Invalid Flask application instance")
107+
raise TypeError("Invalid Flask application instance")
108108

109109
self.app = app
110110

@@ -119,7 +119,7 @@ def init_app(self, app, config=None):
119119
if self in app.extensions["mongoengine"]:
120120
# Raise an exception if extension already initialized as
121121
# potentially new configuration would not be loaded.
122-
raise Exception("Extension already initialized")
122+
raise ValueError("Extension already initialized")
123123

124124
if not config:
125125
# If not passed a config then we read the connection settings

0 commit comments

Comments
 (0)