Hey Brian: do you know why i cant implement an error throw on this file uploader helper, my code is as follows:
On the Helper Module:
got the exit:
uploadError: {
description: 'Error cuando las credenciales o la conectividad con AWS esta quebrada',
message: 'No se pudo conectar con el servidor AWS'
}
file.upload(options, async (err, files) => {
if (err) { throw 'uploadError'; }
//Success
const fileUrl = files[0].extra.Location;
return exits.success(fileUrl);
});
and on the create-post file i got the same try block you got but with an interceptor (implemented just as the docs said.)
try {
const fileUrl = await sails.helpers.fileuploader(file, bucket)
.intercept('uploadError', 'message');
And the only error i got on the server is the following:
node:14090) UnhandledPromiseRejectionWarning: uploadError
(node:14090) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:14090) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Any ideas what am i missing?