mirror of
https://git.disroot.org/pranav/pybatmesh.git
synced 2024-11-08 21:52:35 +05:30
made error messages more readable
Not a big commit, so pushed directly to master
This commit is contained in:
parent
5f7c59d4b8
commit
8137b5067b
@ -1,5 +1,9 @@
|
||||
# Changelog
|
||||
|
||||
## [Unreleased][] - 2021-09-21
|
||||
|
||||
- Better error messages
|
||||
|
||||
## [v0.4.0][] - 2021-09-20
|
||||
|
||||
- naxalnet is now a daemon! naxalnet will reconfigure the WiFi network
|
||||
|
@ -35,4 +35,4 @@ See README.md for documentation.
|
||||
#
|
||||
# In case you forgot to change the version, skip the number
|
||||
# and put the next number in the next commit.
|
||||
__version__ = "0.4.0"
|
||||
__version__ = "0.4.0a1"
|
||||
|
@ -38,3 +38,6 @@ CONFIG = {
|
||||
# glob
|
||||
CONFIG_FILES = ["naxalnet.conf", "naxalnet.conf.d/*.conf"]
|
||||
CONFIG_DIRS = ["/usr/share/naxalnet", "/usr/local/share/naxalnet", "/etc/naxalnet"]
|
||||
|
||||
ISSUE_URL = "https://git.disroot.org/pranav/naxalnet/issues"
|
||||
REPORT_BUG_INFO = "If you think this is a bug, report it to " + ISSUE_URL
|
||||
|
@ -32,6 +32,7 @@ from shutil import copy
|
||||
from dasbus.error import DBusError
|
||||
from systemd.daemon import notify
|
||||
from naxalnet import __version__
|
||||
from naxalnet.default import REPORT_BUG_INFO
|
||||
from naxalnet.log import logger
|
||||
from naxalnet.iwd import Adapter, Device, IWD
|
||||
from naxalnet.config import args
|
||||
@ -57,8 +58,13 @@ def copy_files():
|
||||
# Copy all files in src to dest
|
||||
for i in src.iterdir():
|
||||
copy(i, dest)
|
||||
except PermissionError as error:
|
||||
logger.error("Cannot copy file: %s", error)
|
||||
except PermissionError:
|
||||
logger.exception("A PermissionError occured while copying files")
|
||||
logger.error(REPORT_BUG_INFO)
|
||||
sys.exit(3)
|
||||
except:
|
||||
logger.exception("An unknown error occured while copying files")
|
||||
logger.error(REPORT_BUG_INFO)
|
||||
sys.exit(3)
|
||||
|
||||
|
||||
@ -129,6 +135,11 @@ def setup_devices():
|
||||
|
||||
except DBusError:
|
||||
logger.exception("Error while communicating with iwd")
|
||||
logger.error(REPORT_BUG_INFO)
|
||||
sys.exit(4)
|
||||
except:
|
||||
logger.exception("An unknow error occured while setting up the mesh")
|
||||
logger.error(REPORT_BUG_INFO)
|
||||
sys.exit(4)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user