| |
@@ -7,6 +7,7 @@
|
| |
import sqlalchemy
|
| |
import json
|
| |
import requests
|
| |
+ from requests.exceptions import RequestException, InvalidSchema
|
| |
from wtforms import ValidationError
|
| |
|
| |
from werkzeug import secure_filename
|
| |
@@ -1010,11 +1011,8 @@
|
| |
"message": "Created module {}".format(module.nsv),
|
| |
})
|
| |
|
| |
- except ValidationError as ex:
|
| |
- raise LegacyApiError(ex.message)
|
| |
-
|
| |
- except requests.RequestException as ex:
|
| |
- raise LegacyApiError(ex.message)
|
| |
+ except (ValidationError, RequestException, InvalidSchema) as ex:
|
| |
+ raise LegacyApiError(str(ex))
|
| |
|
| |
except sqlalchemy.exc.IntegrityError:
|
| |
raise LegacyApiError("Module {}-{}-{} already exists".format(
|
| |
Two little fixes in this PR
InvalidSchema
schema exception when submitting module build via --url.repo
in module repofile URL, so you can easily wget it without specifying the filename