Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
archlinux
archversion
Commits
ad98138e
Commit
ad98138e
authored
Nov 18, 2018
by
Seblu
Browse files
Handle unknown and fatal execptions equally
parent
93f5feb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/archversion
View file @
ad98138e
...
...
@@ -23,7 +23,7 @@
from
archversion
import
VERSION
,
CONFIG_SENDMAIL
from
archversion.config
import
BaseConfigFile
from
archversion.error
import
BaseError
,
MissingConfigFile
,
NoSuchFile
from
archversion.error
import
ERR_FATAL
,
ERR_ABORT
,
ERR_UNKNOWN
from
archversion.error
import
ERR_FATAL
,
ERR_ABORT
from
archversion.pacman
import
parse_pkgbuild
,
pkgbuild_set_version
,
pkgbuild_update_checksums
from
archversion.version
import
VersionController
from
email.mime.text
import
MIMEText
...
...
@@ -268,15 +268,11 @@ def main():
return
args
.
func
(
args
,
vctrl
)
except
KeyboardInterrupt
:
exit
(
ERR_ABORT
)
except
BaseError
as
exp
:
logging
.
error
(
exp
)
exit
(
ERR_FATAL
)
except
Exception
as
exp
:
logging
.
error
(
"Unknown error. Please report it with --debug."
)
logging
.
error
(
exp
)
logging
.
critical
(
exp
)
if
logging
.
getLogger
().
getEffectiveLevel
()
==
logging
.
DEBUG
:
raise
exit
(
ERR_
UNKNOWN
)
exit
(
ERR_
FATAL
)
if
__name__
==
'__main__'
:
main
()
...
...
src/lib/archversion/error.py
View file @
ad98138e
...
...
@@ -24,7 +24,6 @@ import logging
ERR_USAGE
=
1
ERR_FATAL
=
2
ERR_ABORT
=
3
ERR_UNKNOWN
=
4
class
BaseError
(
Exception
):
'''First ancenstor of errors'''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment