Proxyman icon indicating copy to clipboard operation
Proxyman copied to clipboard

[Scripting] Better error message when missing the `return` in `onRequest()` and `onResponse()`

Open NghiaTranUIT opened this issue 3 years ago • 1 comments

Description

If we execute this script:

func onRequest(context, url, request) {
    // No return here
}

We will get this unclear error:

❌Error: TypeError: undefined is not an object (evaluating 'newResponse.headers')

We should fix it.

Acceptance Criteria

  • Check this scenario and present the friendly error message 👍

NghiaTranUIT avatar May 25 '22 01:05 NghiaTranUIT

Done: https://proxyman.s3.us-east-2.amazonaws.com/beta/Proxyman_3.5.0_Friendly_error_message_when_missing_the_return_func.dmg

NghiaTranUIT avatar May 30 '22 04:05 NghiaTranUIT