Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings ignore PERL6_EXCEPTIONS_HANDLER unless there is also an error #2327

Open
Garland-g opened this issue Sep 28, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@Garland-g
Copy link

commented Sep 28, 2018

The Problem

PERL6_EXCEPTIONS_HANDLER=JSON does not output warnings in JSON unless there is an error.

Expected Behavior

Prints a warning output in JSON format.

Actual Behavior

Prints a standard warning message

Steps to Reproduce

PERL6_EXCEPTIONS_HANDLER=JSON perl6 -e '/win 3/'

outputs

Potential difficulties:
    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)
    at -e:1
    ------> /win⏏ 3/

But failing to terminate the regex like this:

PERL6_EXCEPTIONS_HANDLER=JSON perl6 -e '/win 3'

displays the warning in JSON format, along with the unterminated regex error.

{
  "X::Comp::Group" : {
    "message" : "Regex not terminated.\nUnable to parse regex; couldn't find final '/'\nSpace is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
    "panic" : "Unable to parse regex; couldn't find final '/'",
    "sorrows" : [
      {
        "X::Syntax::Regex::Unterminated" : {
          "highexpect" : [
            "infix stopper"
          ],
          "pos" : 6,
          "is-compile-time" : 1,
          "modules" : [ ],
          "post" : "<EOL>",
          "message" : "Regex not terminated.",
          "line" : 1,
          "filename" : "-e",
          "column" : null,
          "pre" : "/win 3"
        }
      }
    ],
    "worries" : [
      {
        "X::Comp::AdHoc" : {
          "filename" : "-e",
          "line" : 1,
          "column" : null,
          "pre" : "/win",
          "highexpect" : [ ],
          "payload" : "Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
          "post" : " 3",
          "message" : "Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)",
          "modules" : [ ],
          "is-compile-time" : true,
          "pos" : 4
        }
      }
    ]
  }
}

Environment

  • Operating system: Linux 4.19
  • Compiler version (perl6 -v): perl6 2018.08, and Rakudo version 2018.09-43-gddb5f8fc4 built on MoarVM version 2018.09-90-gb5eb48c2e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.