Uploaded image for project: 'Erlang/OTP'
  1. Erlang/OTP
  2. ERL-1310

epp:format_error crashes on an error returned from epp:parse_file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 23.0
    • Fix Version/s: 23.1
    • Component/s: compiler, stdlib
    • Labels:
      None

      Description

      Given a file test.erl with the following contents:

      -if(?foo).
      -else.
      -error("not foo").
      -endif.

      Parsed using

      {ok, Epp} = epp:open("test.erl"), 
      epp:parse_file(Epp)
      

      an error in the form of {error,{1,epp,{error,1,{undefined,foo,none}}}} is returned. According to the error convention, it should be possible to call epp:format_error({error,1,{undefined,foo,none)}}, but that call crashes. It seems that either this format of error should be handled in epp:format_error or the error format should be changed to match other errors. In particular it seems there's some extra wrapping in an error tuple going on in here.

        Attachments

          Activity

            People

            Assignee:
            bjorn Björn Gustavsson
            Reporter:
            michalmuskala Michał Muskała
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: