From a4df1481d6108731e231750721e4d2cfe0cee8bd Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 30 Oct 2023 21:41:03 +0700 Subject: all: refactoring Local and Play so that error get logged Previously, if there is any error from Local or Play before any statement get executed it will not logged to log, also the Request close() is not called since we put it as defer in the middle. This changes fix this by moving down error handler into single exit goto label. --- testdata/local/local_encrypted.data | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testdata') diff --git a/testdata/local/local_encrypted.data b/testdata/local/local_encrypted.data index 54cec22..f08467c 100644 --- a/testdata/local/local_encrypted.data +++ b/testdata/local/local_encrypted.data @@ -7,9 +7,15 @@ this_is_a_secret <<< echo_encrypted_no_pass Local: NewScript: ParseScript: template: local_encrypted.aww:3:7: executing "local_encrypted.aww" at <.Val>: error calling Val: "secret::pass" is empty +<<< echo_encrypted_no_pass:output +- local_encrypted.aww !!! NewScript: ParseScript: template: local_encrypted.aww:3:7: executing "local_encrypted.aww" at <.Val>: error calling Val: "secret::pass" is empty + <<< echo_encrypted_invalid_pass Local: NewSession: .awwan.env.vault: LoadPrivateKeyInteractive: x509: decryption password incorrect +<<< echo_encrypted_invalid_pass:output +- local_encrypted.aww !!! NewSession: .awwan.env.vault: LoadPrivateKeyInteractive: x509: decryption password incorrect + <<< sub_echo_encrypted - local_encrypted.aww === BEGIN: local testdata/local/sub/local_encrypted.aww 1 - local_encrypted.aww --> 1: echo this_is_a_secret_in_sub -- cgit v1.3