Skip to content

Commit 2899869

Browse files
authored
Update index.md
Added line to indicate a good location for custom exception classes inline with https://github.com/moodle/moodle/blob/main/lib/apis.json#L107
1 parent d5cb6dc commit 2899869

File tree

1 file changed

+3
-1
lines changed
  • general/development/policies/codingstyle

1 file changed

+3
-1
lines changed

general/development/policies/codingstyle/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2054,7 +2054,9 @@ We have a set of custom exception classes. The base class is moodle_exception. Y
20542054

20552055
To get the full list of exception types, search for the regular expression 'class +\w+_exception +extends' or ask your IDE to list all the subclasses of moodle_exception.
20562056

2057-
Where appropriate, you should create new subclasses of moodle_exception for use in your code.
2057+
Where appropriate, you should create new subclasses of moodle_exception for use in your code.
2058+
2059+
If you create a custom exception class it *may* live in the `classes/exception/` directory, and be namespaced in `<plugin>/exception/`
20582060

20592061
A few notable exception types:
20602062

0 commit comments

Comments
 (0)