New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cloudinary upload error message #6525
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6525 +/- ##
==========================================
+ Coverage 19.85% 19.98% +0.13%
==========================================
Files 857 858 +1
Lines 12076 12097 +21
Branches 1963 1965 +2
==========================================
+ Hits 2398 2418 +20
- Misses 8093 8094 +1
Partials 1585 1585
Continue to review full report at Codecov.
|
Hi @sudhirt4, I don't think these errors should be sent back by the API. We should log them and send a upload error instead so we don't leak too many information |
@alexandrebodin |
@@ -19,7 +19,8 @@ module.exports = { | |||
{ resource_type: 'auto', public_id: file.hash, ...customConfig }, | |||
(err, image) => { | |||
if (err) { | |||
return reject(err); | |||
console.log(`Error uploading to cloudinary: ${err.message}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here you will need to use strapi.log.error()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
Signed-off-by: Sudhir Shrestha <sudhirshrestha@live.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thanks for the improvement
Signed-off-by: Sudhir Shrestha <sudhirshrestha@live.com> Signed-off-by: harimkims <harimkims@gmail.com>
Signed-off-by: Sudhir Shrestha <sudhirshrestha@live.com> Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
This is a minor pull request that fixes the propagation of error from cloudinary to strapi error middleware (err at : boom.Boomify).
Before (when entering invalid cloudinary config)
After