Comments (4)
Hi @smarek I'm so glad you're finding the plugin useful. I'm not sure I completely understand whats going on, are you saying you're getting this warning on every page load emailed to you whether you have other errors on the page or not? If that is the case its most likely because you have accidentally added some space before an opening <?php
tag somewhere. Anytime you have output before you send headers php will complain. Fixing this issue would stop the emails if that's whats going on. And if that is indeed what is going on I don't think the emails are being sent in error they are just telling you about this issue.
This plugin itself should not be producing any output to the screen so I don't think it would be causing the warnings you're seeing by itself.
If its not the scenario outlined above do you have a simple example I can follow with a default install of cakephp to reproduce it?
from cakephp-error-email.
Hi @ebrigham1
no, the library works fine, and i'm talking about specific cases, where errorneous state of application will cause premature output and php complains.
This mentioned php complaning i'd like to ignore (not get the 2 additional emails), either at all
(impractical) or if there is at least one more error/warning being reported by the plugin
(optimal)
of course, ignoring completely php complaining is not good idea, however when warning is issued, and you get 1 email about warning and 2 emails about php complaining, it's not very nice
from cakephp-error-email.
Hi @smarek
Well there currently isn't anything built in to throttle emails per request. If i'm understanding correctly that's what it sounds like you're interested in? I don't see any reason why it couldn't be built in so if you feel like making a pull request for that type of functionality I could review it and accept it pending testing. One thing I would be concerned about is if its limited to 1 email per request could other emails be getting discarded that may be important to debugging the issue?
Another option you could go with is just not email the "warning" level though then you would get no warnings at all which could be undesirable.
I'm still not understanding how the plugin is triggering these excess emails as in a default cakephp install if i trigger an error in controller code before it renders a view I do not get these additional emails so I still think you have a whitespace issue somewhere in your code before a php tag which is always triggering these warnings which could fix your issue if removed.
from cakephp-error-email.
@ebrigham1 yes, initially the ticket was meant for discussion about best approach to handle this.
However one could probably solve this with subclassing as well, but i did not attempt to do that so far.
Throttling is maybe not the best name for the feature, because we don't want to limit the number of sent emails disregarding order of warnings/errors (even though I think it's usually deterministic order)
Maybe aggregating the reports from single request would be better approach? Ie. not sent separate email for every warning/error thrown, but aggregate all the rendered emails and sent them in single e-mail (indication of errors/warnings count in the email title and as prefix of content body would be probably necessary)
And again, no, this plugin is not cause of excess emails, there is nothing that this plugin is doing, that would make any situation worse than it already is.
from cakephp-error-email.
Related Issues (14)
- Async mails HOT 2
- Not notify Cake\Http\Exception\HttpException HOT 6
- Error after updating to CakePHP 3.8 HOT 6
- EmailThrowableTrait access to context / overriding default algorithms HOT 1
- Long error message causes "File name too long" issue
- CakePHP 4.x support
- Composer HOT 3
- Image for README
- sending emails on warnings and notice error also HOT 7
- Updating preview
- Not working HOT 5
- Replace deprecated 'here' attribute HOT 1
- Replace deprecated methods setTemplate() and setLayout() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakephp-error-email.