November 30, 2022
https://issues.dlang.org/show_bug.cgi?id=23526

          Issue ID: 23526
           Summary: Allow libraries to display custom error messages with
                    same flexibility as compiler
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: john.michael.hall@gmail.com

From https://forum.dlang.org/post/ooraoriyrftjrpoygtnk@forum.dlang.org

Allowing library code to *display* its own custom error messages, with the same control and flexibility the compiler has for built-in messages (currently we only have `static assert`).

--