Skip to content

Commit e4b08c3

Browse files
committed
Use platform exception handling
1 parent da768bf commit e4b08c3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sonar/projects.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,7 @@ def create(cls, endpoint: pf.Platform, key: str, name: str) -> Project:
214214
:return: The Project
215215
:rtype: Project
216216
"""
217-
try:
218-
endpoint.post(Project.API[c.CREATE], params={"project": key, "name": name})
219-
except (ConnectionError, RequestException) as e:
220-
util.handle_error(e, f"creating project '{key}'", catch_http_statuses=(HTTPStatus.BAD_REQUEST,))
221-
raise exceptions.ObjectAlreadyExists(key, e.response.text)
217+
endpoint.post(Project.API[c.CREATE], params={"project": key, "name": name})
222218
o = cls(endpoint, key)
223219
o.name = name
224220
return o

0 commit comments

Comments
 (0)