~petrus/mailctl-discuss

3 2

Suggestion: user friendly error message instead of exception when config file has not been found

Arthur Borsboom <a.borsboom@aramgroup.com>
Details
Message ID
<AM9PR07MB7123DA698F8F1C14240C465D99B99@AM9PR07MB7123.eurprd07.prod.outlook.com>
DKIM signature
missing
Download raw message
Today I tried to test mailctl on a wrong user account, which was not configured to use mailctl.
mailctl returned an understandable error message, which included an exception.
Although it does work and the error is clear, it would be nicer if it would not throw an exception with a call stack, but just a friendly error message.

Current:

[user@server ~]$ mailctl access xxxx-support
mailctl: YAML exception:
Yaml file not found: /YOUR-HOME-DIRECTORY/.config/mailctl/services.yaml
CallStack (from HasCallStack):
  error, called at lib/MailCtl/Environment.hs:146:19 in mailctl-0.8.5-71002bc4b8a7bd36080a3629155cfaa38c6d6da67b36c6b39342f0069f2f6e52:MailCtl.Environment
[user@server ~]$ 

Proposed:

[user@server ~]$ mailctl access xxxx-support
Failed to find the configuration file:  /YOUR-HOME-DIRECTORY/.config/mailctl/services.yaml
For more information, see 'mailctl --help'
[user@server ~]$ 

If the callstack is needed, it could be shown by --debug or similar.



With kind regards / met vriendelijke groet,









Arthur Borsboom


IT consultant 









Aram | Uw kennispartner


T: +31 (0)10 - 2707004 |
M: +31 (0)6 - 29089953

aramgroup.com | 
E: a.borsboom@aramgroup.com


Rivium Quadrant 58, 2909 LC, Capelle a/d IJssel
Arthur Borsboom <a.borsboom@aramgroup.com>
Details
Message ID
<AM9PR07MB7123EA0F26AAC89641BECBC199B99@AM9PR07MB7123.eurprd07.prod.outlook.com>
In-Reply-To
<AM9PR07MB7123DA698F8F1C14240C465D99B99@AM9PR07MB7123.eurprd07.prod.outlook.com> (view parent)
DKIM signature
missing
Download raw message
AB> Today I tried to test mailctl on a wrong user account, which was not configured to use mailctl.
AB> mailctl returned an understandable error message, which included an exception.

I just noticed that when the config.yaml file doesn't exist, it does show a clean error message.
The issue seems to be when the services.yaml file cannot be found.

[user@server]# mailctl access xxxx-support
Can't find configuration file: /root/.config/mailctl/config.yaml
[user@server]#
Details
Message ID
<20230313215842.blthlo4frb24avl4@localhost>
In-Reply-To
<AM9PR07MB7123DA698F8F1C14240C465D99B99@AM9PR07MB7123.eurprd07.prod.outlook.com> (view parent)
DKIM signature
missing
Download raw message
On Mon, Mar 13, 2023 at 09:02:37AM +0000, Arthur Borsboom wrote:
> Although it does work and the error is clear, it would be nicer if it
> would not throw an exception with a call stack, but just a friendly
> error message.

Done. See: https://lists.sr.ht/~petrus/mailctl-announce
Arthur Borsboom <a.borsboom@aramgroup.com>
Details
Message ID
<AM9PR07MB71233BF41E435ACE7C4C1F4599BE9@AM9PR07MB7123.eurprd07.prod.outlook.com>
In-Reply-To
<20230313215842.blthlo4frb24avl4@localhost> (view parent)
DKIM signature
missing
Download raw message
On Mon, Mar 13, 2023 at 09:02:37AM +0000, Arthur Borsboom wrote:
>> Although it does work and the error is clear, it would be nicer if it
>> would not throw an exception with a call stack, but just a friendly
>> error message.

> Done. See: https://lists.sr.ht/~petrus/mailctl-announce

Tested and confirmed to work.
Thanks for the help.
Reply to thread Export thread (mbox)