How to catch Moodle exceptions in a CLI script ?

Re: How to catch Moodle exceptions in a CLI script ?

autor Johnny Drud -
Počet odpovědí: 0

Hi Benjamin

You are catching the exception in a namespace. That means you have to escape the exception like this:

try

{

   // Your code

}

catch (\Exception $e)

{

   // Handle exception

}