main: try catch block

This commit is contained in:
Dawid Dziurla 2020-02-29 23:13:30 +01:00
parent fced312130
commit ae7db41acb
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

20
main.js
View File

@ -12,14 +12,15 @@ function get_body(body) {
} }
async function main() { async function main() {
server_address = core.getInput("server_address", {required: true}) try {
server_port = core.getInput("server_port", {required: true}) server_address = core.getInput("server_address", { required: true })
username = core.getInput("username", {required: true}) server_port = core.getInput("server_port", { required: true })
password = core.getInput("password", {required: true}) username = core.getInput("username", { required: true })
subject = core.getInput("subject", {required: true}) password = core.getInput("password", { required: true })
body = core.getInput("body", {required: true}) subject = core.getInput("subject", { required: true })
to = core.getInput("to", {required: true}) body = core.getInput("body", { required: true })
from = core.getInput("from", {required: true}) to = core.getInput("to", { required: true })
from = core.getInput("from", { required: true })
html = core.getInput("html") || "false" html = core.getInput("html") || "false"
transport = nodemailer.createTransport({ transport = nodemailer.createTransport({
@ -41,6 +42,9 @@ async function main() {
}) })
console.log(info) console.log(info)
} catch (error) {
core.setFailed(error.message)
}
} }
main() main()