mirror of
https://github.com/plankanban/planka.git
synced 2025-12-18 01:11:13 +03:00
fix: Fix error output when sending email or message to Slack
This commit is contained in:
@@ -20,7 +20,7 @@ const mapStateToProps = (state) => {
|
|||||||
isSubmittingUsingOidc,
|
isSubmittingUsingOidc,
|
||||||
error,
|
error,
|
||||||
withOidc: !!oidcConfig,
|
withOidc: !!oidcConfig,
|
||||||
isOidcEnforced: oidcConfig && oidcConfig.isEnforced,
|
isOidcEnforced: !!oidcConfig && oidcConfig.isEnforced,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ module.exports = {
|
|||||||
from: sails.config.custom.smtpFrom,
|
from: sails.config.custom.smtpFrom,
|
||||||
});
|
});
|
||||||
|
|
||||||
sails.log.info('Email sent: %s', info.messageId);
|
sails.log.info(`Email sent: ${info.messageId}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
sails.log.error(error); // TODO: provide description text?
|
sails.log.error(`Error sending email: ${error}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -35,19 +35,19 @@ module.exports = {
|
|||||||
body: JSON.stringify(body),
|
body: JSON.stringify(body),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
sails.log.error(error); // TODO: provide description text?
|
sails.log.error(`Error sending to Slack: ${error}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
sails.log.error('Error sending to Slack: %s', response.error);
|
sails.log.error(`Error sending to Slack: ${response.error}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const responseJson = await response.json();
|
const responseJson = await response.json();
|
||||||
|
|
||||||
if (!responseJson.ok) {
|
if (!responseJson.ok) {
|
||||||
sails.log.error('Error sending to Slack: %s', responseJson.error);
|
sails.log.error(`Error sending to Slack: ${responseJson.error}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user