Bug 16121 – the canonical way to create and use an exception type is not documented on dlang.org

Status
NEW
Severity
enhancement
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-06-04T21:42:13Z
Last change time
2024-12-15T15:23:27Z
Assigned to
No Owner
Creator
Piotr
Moved to GitHub: dlang.org#4051 →

Comments

Comment #0 by poliklosio.dlang — 2016-06-04T21:42:13Z
As a new D user I need basic information, for example if an exception should be a class or struct, what class it should inherit from, and what is a good or typical way to pass exception message in D. An example that I can easily spot and analyze would be by far the best way to provide this. I've been searching for this but could not find such example. When I search for "dlang exception handling", the first page that google redirects me to is: https://dlang.org/spec/errors.html It doesn't contain the needed info. Then I tried to navigate manually to a page that should contain the information. I landed on: https://dlang.org/exception-safe.html No luck there either.
Comment #1 by ag0aep6g — 2016-06-04T22:04:25Z
(In reply to Piotr from comment #0) > As a new D user I need basic information, for example if an exception should > be a class or struct, what class it should inherit from, > and what is a good > or typical way to pass exception message in D. > An example that I can easily spot and analyze would be by far the best way > to provide this. Must be a class that inherits from Throwable. And usually you inherit from Exception. > I've been searching for this but could not find such example. > When I search for "dlang exception handling", the first page that google > redirects me to is: > https://dlang.org/spec/errors.html > It doesn't contain the needed info. > Then I tried to navigate manually to a page that should contain the > information. I landed on: > https://dlang.org/exception-safe.html > No luck there either. One page you should be able to find is this: https://dlang.org/library/object/exception.html I agree that there should be a document describing the matter. Maybe there is and we both just can't find it.
Comment #2 by robert.schadek — 2024-12-15T15:23:27Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4051 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB