bgrabitmap / bgrabitmap

📜 BGRABitmap graphics library made with Lazarus (Free Pascal).
https://bgrabitmap.github.io/
197 stars 31 forks source link

'exception' class #207

Open Alexey-T opened 1 year ago

Alexey-T commented 1 year ago

in unitbitmapgeneric.inc we have 3 'exception.create()`. would be better to use uniq class instead of 'exception'. eg in IDE i will be able to set 'Ignore errors of this class' UI option.

and: typo 'Semi-tranparent

circular17 commented 1 year ago

Hi Alexey,

I am not sure what would be the change for the exception. Can you show me?

Alexey-T commented 1 year ago
type
  TBgraException = class(Exception);

...
  raise TBgraException.Create('text here');
circular17 commented 1 year ago

I see, why not

circular17 commented 6 months ago

Hi Alexey,

Reflecting on your suggestion, it seems that for exception, there is a convention to prefix with E. So I presume we could define following exceptions:

Other exceptions would be descendants:

This would be a descendant of EMultifileContainerError:

This would be a descendant of EBGRABitmapError:

This would be a descendant of ELayeredBitmapError:

I am not sure it convers absolutely everything, however this would give some structure to the exceptions.