#770 fn:error()

eXist-db 2.0
open
None
5
2012-11-27
2012-02-25
cjwallace
No
0 up votes | 0 down votes | 0%
8 comments

when an error is raised with a third paramter, this value is not reported in the exception text:
eg. fn:error((),"error", 5)

this is a change for from 1.4.2

version 2.0-tech-preview

Discussion

  • Dannes Wessels
    Dannes Wessels
    2012-02-26

    Are you reporting about the new try-catch functionality? please could you write a complete query?

     
  • cjwallace
    cjwallace
    2012-02-26

    No - just that function alone

     
  • Dannes Wessels
    Dannes Wessels
    2012-02-26

    The behavior is indeed been changed; This has all to do with the new try-ctach functionality. There is now a clear separation between the error message and the 'additional' provided data. in 1.4 all was put in one message.

    Putting back the data into the message would kind of break the new try-catch feature......

    not sure what to do yet

     
  • Dannes Wessels
    Dannes Wessels
    2012-03-23

    I close this ticket, if you agree. the change is intentionally

     
  • cjwallace
    cjwallace
    2012-03-23

    I dont know what you mean by 'intentional' - however it has the effect of changing its behavior in a way which makes it useless for debugging purposes .

     
  • Dannes Wessels
    Dannes Wessels
    2012-03-24

    The fn:error has been reimplemented for the try-catch functionality, the requested information is now present as err:value in the catch clause

    The information of the 3rd parameter is not lost. Adding it to the error text don't look to be a good idea for me.

    Can you help me to think of an other solution?

    http://www.w3.org/TR/xpath-functions/
    http://www.w3.org/TR/xquery-30/#id-try-catch

     
  • cjwallace
    cjwallace
    2012-03-25

    The use case that I have for this function is in debugging where I insert an fn:error to report some values at that point and halt. If err:value is available in the context of the bare function call then I can still get at it but if its only avaliable in the try/catch context then I have a problem - perhaps I've just developed a bad habit and you can suggest an alternative.

     
  • Dannes Wessels
    Dannes Wessels
    2012-11-27

    • assigned_to: Dannes Wessels
    • milestone: --> eXist-db 2.0