1

Is it possible for me to use the default Craft error-handling/exception-throwing/debug-showing template layout for my own plugin? Let's say something goes wrong and I want to show that to the user in the same style as any other "code related error" for my Plugin.

Could/how would I achieve this?

2

If I'm understanding your question correctly, then you get that behavior by default.

If you:

throw new Exception('Uh oh.');

Then you'll get the same error handling layout and logic that Craft uses.

You can read here for more information on how that works.

1
  • ... I don't even know why I just didn't try this. Cheers Brad :) – naboovalley Nov 4 '14 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.