Questions tagged [error-handling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
24 views

How do I show errors for a new front end entry form?

I'm using a front end form so logged-in users can create a new entry ("post") or edit an existing entry. Here's the controller for figuring out whether it's a new or existing entry: {# Get the entry ...
1
vote
1answer
175 views

Error pages in multi site setup

I have a multi site setup for supporting multiple languages in Craft 3. '/' => German '/en/' => English In my general.php I have 'errorTemplatePrefix' => 'error/', When I enter '/...
1
vote
3answers
77 views

How to display payment gateway error message only

I am trying to display the error message coming from the payment gateway ONLY. I know I can use {% set message = craft.app.session.getFlash('error') %} {{ message|length ? message }} but commerce ...
1
vote
1answer
191 views

How can I test my 500 error page works

I had a problem with my cloud server and all my sites were generating 500 errors. The response page the visitor saw varied between Craft 2, Craft 3 and ExpressionEngine 2 sites. The Craft 3 ones ...
1
vote
1answer
109 views

Internal Server Error: missing method or closure

Receiving the standard error: Craft\MatrixBlockModel and its behaviors do not have a method or closure named "sectionArticles". The problem is that this error doesn't make sense. Here is why: I ...
0
votes
1answer
49 views

Multiple dev sites

Running a number of development sites on MAMP Pro and repeatedly receive this alert when attempting to update. Updates are consciously being performed nonsimultaneously, but that does not seem to ...
2
votes
2answers
177 views

amforms no error handling

I have this form (am forms plugin): {% macro errorList(errors) %} {% if errors %} <ul class="errors"> {% for error in errors %} <li>{{ error }}</li> ...
2
votes
1answer
551 views

Correct way of showing errors when editing profile via front-end form?

I've been looking at the following resources: https://craftcms.com/docs/templating/user-profile-form Allow user to change or delete their photo for their profile from the front end Front end edit: ...
2
votes
0answers
466 views

Does Craft expose PHP errors when not in devMode? [closed]

I'm seeing a lot of tasks hanging in Craft. Specifically, DeleteStaleTemplateCaches and GeneratePendingTransforms. I've followed the advice and instructions at https://craftcms.com/support/stuck-tasks ...
2
votes
2answers
319 views

Error reporting Freeform submission jumps to top of page

When submitting a form with required fields and getting an error, the page jumps to the top, where it should jump to the top of the form. In the standard Craft contact form I can add <form ...
1
vote
1answer
261 views

Trouble passing errors back to form through setRouteVariables

This has me a bit stumped. I have two forms - posting to two different actions within the same controller. On error I am attempting to have them both display a flash-notice, as well as pass the model ...
4
votes
1answer
975 views

Is it possible to make Craft/Twig throw 404 if a template can't be found?

Attempting to include a template that doesn't exist throws HttpStatus 500 – Craft\TemplateLoaderException – Unable to find the template “{template}”. This is usually fine and what you want, but is it ...
3
votes
1answer
541 views

How to suppress server errors in Craft?

On certain pages of my site, I download and display resized (using the Imager plugin) images from remote site. Now, sometimes that remote site returns error and in such case Imager is throwing ...
1
vote
1answer
134 views

Setting tab 'error' class for tab with error

When creating an editor interface within my plugin, I am using the following snippet to create a set of tabs inside a tab pane: {% include "_includes/tabs" with { tabA: { label: 'Tab A'|t, url: '#...
1
vote
1answer
66 views

Craft internal error exposing sensitive data

I have a craft installation and recently my server had issues and on the page rendering mysql and other errors were shown. Of course this creates security implications. Is there a way to restrict ...
0
votes
2answers
1k views

Getting image url error code: Impossible to access an attribute (“url”) on a null variable

My site just suddenly broke down on a certain page with the following error code, (see screenshot). It is occuring for every image on this page and really confusing me. Any quick suggestions?
2
votes
3answers
2k views

An exception has been thrown during the rendering of a template (“”)

Struggling to debug this one. The full log is as follows: Next exception 'Twig_Error_Runtime' with message 'An exception has been thrown during the rendering of a template ("") in "book/poll-...
3
votes
1answer
97 views

Integrate Bugsnag

What would be a good approach to integrate a service like Bugsnag? Is there some kind of global Error/Exception Handler where everything is routed through and I could hook in? Edit: Find the finished ...
4
votes
1answer
1k views

How can I get a full stack trace in my custom plugin log?

I'm using MyPlugin::log to separate the errors for my plugin. However, I'm only able to log a simple message using this technique. Is it possible to have that output the full stack trace? Here's ...
2
votes
1answer
511 views

How to catch errors in a service and return to a controller?

How do you handle “catching” errors in a plugin service and return the error to the plugins controller? To be more specific... I am sending an Ajax request to a controller, that controller is ...
0
votes
1answer
420 views

Return to default error handling

In my plugin, I'd like to catch errors when they appear in the control panel, so I can handle them differently. However, from the front-end, I'd like to keep the default Craft-style handling of error ...