Re: [go-nuts] What is a ordinary and exceptional error?

2023-10-04 Thread Jerry Londergaard
On Monday, 2 October 2023 at 12:00:35 am UTC+11 Axel Wagner wrote: On Sun, Oct 1, 2023 at 2:37 PM Jerry Londergaard wrote: I've been thinking about this point as well lately. I think I understand (at least some of) the conditions under which you would call a panic(), but I still don't quite

Re: [go-nuts] What is a ordinary and exceptional error?

2023-10-01 Thread Kamil Ziemian
Axel Wagner, you opinin is highly appriciated. niedziela, 1 października 2023 o 15:00:35 UTC+2 Axel Wagner napisał(a): > On Sun, Oct 1, 2023 at 2:37 PM Jerry Londergaard > wrote: > >> I've been thinking about this point as well lately. I think I understand >> (at least some of) the conditions

Re: [go-nuts] What is a ordinary and exceptional error?

2023-10-01 Thread 'Axel Wagner' via golang-nuts
On Sun, Oct 1, 2023 at 2:37 PM Jerry Londergaard wrote: > I've been thinking about this point as well lately. I think I understand > (at least some of) the conditions under which > you would call a panic(), but I still don't quite grok why it's better > than returning an error if that error is

Re: [go-nuts] What is a ordinary and exceptional error?

2023-10-01 Thread Jerry Londergaard
I've been thinking about this point as well lately. I think I understand (at least some of) the conditions under which you would call a panic(), but I still don't quite grok why it's better than returning an error if that error is properly handled. If I panic(), then no defer() statements will

Re: [go-nuts] What is a ordinary and exceptional error?

2023-09-30 Thread Kamil Ziemian
Thank you mister Rader, this was what I needed. I think I now have intuition what this text want to say. Best regards Kamil piątek, 29 września 2023 o 23:58:39 UTC+2 Kurtis Rader napisał(a): > An ordinary error is one that can be expected to occur. For example, > opening a file may fail

Re: [go-nuts] What is a ordinary and exceptional error?

2023-09-29 Thread Kurtis Rader
An ordinary error is one that can be expected to occur. For example, opening a file may fail because the file does not exist or the process doesn't have permission to open it. An exceptional error is one that is not expected to occur and often indicates the state of the program is invalid. For

[go-nuts] What is a ordinary and exceptional error?

2023-09-29 Thread Kamil Ziemian
Hello, In Go FAQ we read "We believe that coupling exceptions to a control structure, as in the try-catch-finally idiom, results in convoluted code. It also tends to encourage programmers to label too many ordinary errors, such as failing to open a file, as exceptional.", " Go also has a