Questions tagged [error-handling]

The tag has no usage guidance.

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

What's the best strategy for products that are sold?

I wonder what's best practice for products that are sold? My strategy is to add a lightswitch "sold" and don't display sold products on the website and in the sitemap.xml, in the hopes that ...
user avatar
  • 565
1 vote
1 answer
45 views

Basic 404 setup not working

I look at past Q & A about this, but am still perplexed. Not logged in to CP or frontend I have a simple template called 404.twig which resides in the templates folder I can access the template ...
user avatar
  • 596
0 votes
0 answers
206 views

Contact form returning "Error 400: Bad Request: Request missing required param" -- how can I best narrow down the issue?

I'm sort of stumped in troubleshooting the following problem that I'm having with the Contact Form. Below I'll list the code, some of the attributes of the code that may be causing this issue, and the ...
user avatar
  • 11
1 vote
2 answers
102 views

How to receive email notification when an error or bad request happens?

Is it possible to receive email notifications when there is an error or Bad Request issue in Craft CMS? We had an issue where our contact forms were not working due to craft.app.config.general.[...
user avatar
1 vote
1 answer
165 views

Missing field validation on user account edit

I've been implementing a user account page with Craft Commerce and copied over the template found here: https://docs.craftcms.com/v3/dev/examples/user-profile-form.html#simple-profile The issue is ...
user avatar
  • 113
1 vote
1 answer
1k views

Error sending email: Process could not be started [The system cannot find the path specified. craft cms

I'm testing my email and I'm seeing the following error in the web logs: "Error sending email: Process could not be started [The system cannot find the path specified. craft cms" Does anyone know ...
user avatar
  • 21
1 vote
1 answer
553 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 ...
user avatar
1 vote
1 answer
469 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 '/...
user avatar
1 vote
3 answers
517 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 ...
user avatar
1 vote
1 answer
6k 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 ...
user avatar
1 vote
1 answer
172 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 ...
user avatar
  • 41
0 votes
1 answer
108 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 ...
user avatar
  • 598
2 votes
2 answers
191 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> ...
user avatar
  • 3,664
2 votes
1 answer
670 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: ...
user avatar
2 votes
0 answers
745 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 ...
user avatar
  • 21
2 votes
3 answers
608 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 ...
user avatar
  • 1,032
1 vote
1 answer
274 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 ...
user avatar
4 votes
1 answer
1k 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 ...
user avatar
3 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
157 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: '#...
user avatar
1 vote
1 answer
67 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 ...
user avatar
  • 11
0 votes
2 answers
2k 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?
user avatar
  • 151
2 votes
2 answers
3k 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-...
user avatar
  • 1,503
3 votes
1 answer
102 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 ...
user avatar
4 votes
1 answer
2k 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 ...
user avatar
  • 23.6k
2 votes
1 answer
721 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 ...
user avatar
0 votes
1 answer
474 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 ...
user avatar
  • 23.6k