Wow! So turns out it was a silly error on my part. I had tried the Error object previously, but it was while looking at a different part of the code... I was actually looking/changing the 'imagekit' case in the code and being stumped as to why I was still seeing the behavior as I explained. Anyhow, it is working as it should when passing in an Error object. Thanks for the extra insight!
Shard last edited by
I'm working on a plugin that filters out a specific file type and relocates them to a different folder.
Everything works as I want except for two issues that I expect are approximately the same solution.
Since uploadFile fires on all files, I need to do an early filter against the extension/mimetype and exit out on a non-match. When I do so, I am firing the callback with (null, data ) where data is the past object for the filter then returning. The resulting link that shows up in the message has a bad URL.
Similarly, when it passes the extension check, it throws an exception due to the uploaded temp file being moved by my plugin.
I assume in both cases this is an issue with what need to get sent back when the filter wraps up its business for the rest of the "upload" flow. Looking at uploads.js hasn't helped me parse it out.
Looking at the imgur plugin has me more confused than understanding.
Anyone know what needs to occur here?