Re: [Tiki-devel] Is this why Exceptions are mostly dead in tiki? And they must be changed with Trowable?
Marc Laporte <[email protected]>
| Newsgroups | gmane.comp.cms.tiki.devel |
|---|---|
| Message-ID | <[email protected]> |
Hello Aris, Not an answer to your question, but here is some information related to error tracking. Here is a new feature in Tiki23: * https://dev.tiki.org/GlitchTip * https://doc.tiki.org/GlitchTip We'll centralize error messages from various community sites, and this will make it easier to resolve. We can imagine in the future that each error message shown to end users would have a unique ID, and this will help provide actionable information to developers to solve the problems at the source. Best regards, Marc On Mon, 19 Jul 2021 20:42:20 +0000 (UTC) Tiki developers [email protected] said > Hi again, > > Is this why Exceptions are mostly dead in tiki? And they must be changed with > Trowable? > > Writing Code to Support PHP 5.x and 7 Exceptions > To catch any exception in PHP 5.x and 7 with the same code, multiple catch > blocks can be used, catching Throwable first, then Exception . Once PHP > 5.x support is no longer needed, the block catching Exception can be > removed. > try { // Code that may throw an Exception or Error. } catch ( Throwable $t ) > { // Executed only in PHP 7, will not match in PHP 5.x } catch ( Exception $e > ) { // Executed only in PHP 5.x, will not be reached in PHP 7 } > Writing catch-all block compatible with both PHP 5.x and 7 > Unfortunately, type declarations on functions that handle exceptions are not > as easy to fix. If Exception is used as a type declaration on a function > parameter, the type declaration will need to be removed if the function could > be called with an instance of Error . When PHP 5.x support is not required, > the type declaration can be restored as Throwable . > > Thanks, > Aris _______________________________________________ TikiWiki-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/tikiwiki-devel