comparison doc/user_guide.txt @ 8253:cae1bbf2536b

fix: issue2551374 - Add error handling for filter expressions. Fix UI Errors are now reported using the search template. This should work in most situations. However if the query was generated using an alternate search template, the user may not be able to fix it. I'm not sure how to tell what template was used to submit the search. By the time I handle the error, I don't think I have access to an ok template or error template. Might need to add a new field if this becomes a problem. Also fixed a couple of tests changing the status code to 200 from 400 since we aren't on an error page anymore. Updated user_guide including 3 sample error messages for search expressions and how to understand them.
author John Rouillard <rouilj@ieee.org>
date Wed, 01 Jan 2025 02:06:00 -0500
parents 079958914ed7
children 7d72b9a9fe9c
comparison
equal deleted inserted replaced
8252:8a875e0bf749 8253:cae1bbf2536b
489 Typing these expressions manually can be tiresome and tricky. On the 489 Typing these expressions manually can be tiresome and tricky. On the
490 search page, there's an expression editor. You can access it by 490 search page, there's an expression editor. You can access it by
491 clicking on the ``(expr)`` link, which makes creating these 491 clicking on the ``(expr)`` link, which makes creating these
492 expressions a bit easier. 492 expressions a bit easier.
493 493
494 Note that errors in your expression (e.g. a missing operand) are 494 If your expression has an error, you will be returned to the search
495 silently ignored and a fallback search is conducted. This is 495 page and an error will be reported. For example using the expression
496 `considered a bug <https://issues.roundup-tracker.org/issue2551374>`_ 496 ``1, -3`` to search the nosy property of an issue generates the
497 and will hopefully be fixed in the future. But at least you can use 497 following error::
498 this info to understand the search syntax in the URL if you see 498
499 something strange. 499 There was an error searching issue by nosy using: [1, -3]. The
500 operator -3 (and) at position 2 has too few arguments.
501
502 The error message gives you the problem element (``-3``), it's meaning
503 (``and``) and its position: the second element. The problem was caused
504 because ``and`` requires two arguments, but only one argument (``1``)
505 was given.
506
507 Another error message::
508
509 There was an error searching issue by status using: [1, 2, -3,
510 -3]. The operator -3 (and) at position 4 has too few arguments.
511
512 reports that the second ``-3`` in the 4th position is the problem
513 operator. Note that this search expression will never return any
514 values. This is because ``status`` is a single value (link) type
515 property. It can't have the values ``1`` and ``2``, so the expression
516 ``1,2,-3`` will never return an issue.
517
518 In the examples above, the error was caused by not having enough
519 arguments. However you can also have too many arguments. An example of
520 this type of message is::
521
522 There was an error searching issue by nosy using: [4, 5, 1, 2, -3,
523 -3]. There are too many arguments for the existing operators. The
524 values on the stack are: [Value 4, (Value 5 AND (Value 1 AND Value
525 2))]
526
527 This message gives you the expression as far as it was able to compose
528 it, but value 1 is not combined with the rest of the expression. So
529 another binary operator is needed to complete the expression.
530
531 If you have multiple incorrect expressions in your search, only one
532 expression will be reported each time you submit the search.
500 533
501 Using the Classhelper 534 Using the Classhelper
502 --------------------- 535 ---------------------
503 536
504 The classhelper makes finding the id number or name for linked items 537 The classhelper makes finding the id number or name for linked items

Roundup Issue Tracker: http://roundup-tracker.org/