self error: ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

self error: ?

abergel
Hi!

It is frequent to see have guard in the style “self error: ‘Have you forget to add something?’”, to indicate the end user that an API is not properly used.

However, at the execution, it opens a debugger. I have the impression this is not what we want. We probably something more friendly than a full-fledged debugger.

No?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: self error: ?

Sven Van Caekenberghe-2
Object>>#error: signals an Error Exception which, when not handled, indeed results in a debugger. You can easily catch the Error. Of course it is better design to signal more specific exceptions so that they carry more meaning and so that you can handle them at a finer level.

I think that is a fine situation.

I hope you are not suggestion we should open a dialog directly ?

A well defined exception with a good name and string representation should be clear enough, no ?

> On 28 Nov 2014, at 21:35, Alexandre Bergel <[hidden email]> wrote:
>
> Hi!
>
> It is frequent to see have guard in the style “self error: ‘Have you forget to add something?’”, to indicate the end user that an API is not properly used.
>
> However, at the execution, it opens a debugger. I have the impression this is not what we want. We probably something more friendly than a full-fledged debugger.
>
> No?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: self error: ?

abergel
I am not really discussing the need of having well-designed exceptions. But on making the environment friendly for end-users.
Naturally, for a does not understand, it is absolutely fine to have a debugger. A developer should see it. But in case a public method is wrongly used by a supposedly end-user, having a debugger does not help. On OS X, I do not get a stack trace when an error occurs. That would not be friendly. No?

Alexandre


> On Nov 28, 2014, at 5:26 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>
> Object>>#error: signals an Error Exception which, when not handled, indeed results in a debugger. You can easily catch the Error. Of course it is better design to signal more specific exceptions so that they carry more meaning and so that you can handle them at a finer level.
>
> I think that is a fine situation.
>
> I hope you are not suggestion we should open a dialog directly ?
>
> A well defined exception with a good name and string representation should be clear enough, no ?
>
>> On 28 Nov 2014, at 21:35, Alexandre Bergel <[hidden email]> wrote:
>>
>> Hi!
>>
>> It is frequent to see have guard in the style “self error: ‘Have you forget to add something?’”, to indicate the end user that an API is not properly used.
>>
>> However, at the execution, it opens a debugger. I have the impression this is not what we want. We probably something more friendly than a full-fledged debugger.
>>
>> No?
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: self error: ?

Sven Van Caekenberghe-2

> On 28 Nov 2014, at 22:49, Alexandre Bergel <[hidden email]> wrote:
>
> I am not really discussing the need of having well-designed exceptions. But on making the environment friendly for end-users.
> Naturally, for a does not understand, it is absolutely fine to have a debugger. A developer should see it. But in case a public method is wrongly used by a supposedly end-user, having a debugger does not help. On OS X, I do not get a stack trace when an error occurs. That would not be friendly. No?

Yes, I think I know what you want, but consider these:

'non-existing-file' asFileReference readStream.

-1 sqrt.

'abd' at: 4.

I would say that these exceptions and the way they are shown in the debugger are OK, especially for a programming environment.

Consider furthermore

'http://nowhere-at-all.com' asUrl retrieveContents.

[ 'http://nowhere-at-all.com' asUrl retrieveContents ]
  on: NameLookupFailure do: [ #failed ].

The first expression gives a nice dialog, while there is still an exception that can be handled.

My point is: when you take enough care in throwing the (or better a specific) error, you can do nice things, but most of the time we are all lazy.

> Alexandre
>
>
>> On Nov 28, 2014, at 5:26 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>>
>> Object>>#error: signals an Error Exception which, when not handled, indeed results in a debugger. You can easily catch the Error. Of course it is better design to signal more specific exceptions so that they carry more meaning and so that you can handle them at a finer level.
>>
>> I think that is a fine situation.
>>
>> I hope you are not suggestion we should open a dialog directly ?
>>
>> A well defined exception with a good name and string representation should be clear enough, no ?
>>
>>> On 28 Nov 2014, at 21:35, Alexandre Bergel <[hidden email]> wrote:
>>>
>>> Hi!
>>>
>>> It is frequent to see have guard in the style “self error: ‘Have you forget to add something?’”, to indicate the end user that an API is not properly used.
>>>
>>> However, at the execution, it opens a debugger. I have the impression this is not what we want. We probably something more friendly than a full-fledged debugger.
>>>
>>> No?
>>>
>>> Cheers,
>>> Alexandre
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev