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

macros with editing errors should not fill the log with tracebacks #1687

Closed
RogerHaase opened this issue Apr 18, 2024 · 3 comments
Closed

macros with editing errors should not fill the log with tracebacks #1687

RogerHaase opened this issue Apr 18, 2024 · 3 comments
Assignees

Comments

@RogerHaase
Copy link
Member

Remove code similar to:

raise ValueError("Bad timestamp %r: %s" % (args, err))

that fills the log with entries similar to:

Traceback (most recent call last):
  File "C:\GIT\moin\src\moin\macros\Date.py", line 69, in macro
    tm = self.parse_time(tm)
  File "C:\GIT\moin\src\moin\macros\Date.py", line 53, in parse_time
    tm = float(args)
ValueError: could not convert string to float: 'qqq'

and replace it with code that creates an error message so the editor can fix the problem.

@RogerHaase RogerHaase self-assigned this Apr 18, 2024
@ThomasWaldmann
Copy link
Member

Guess these are the options:

  • reject invalid page content (e.g. when containing macros that throw ValueErrors) and do not save such pages, but give a error msg to use and they MUST fix it before it is accepted and saved.
  • accept invalid page content (could be also existing page content migration from moin 1.9.x) - in that case I guess we'll still need the logging or we won't be able to find such pages?

@RogerHaase
Copy link
Member Author

I view the issue as a trivial editing error, similar to a misspelled word. We can show the error in bold text on Preview or Save. It is the editor's task to correct the error. No need to create and log tracebacks.

@UlrichB22
Copy link
Collaborator

The moin import19 command may also add items with invalid macros. IMO we should not reject them.

What do you think about adding a meta field of type bool to mark items with invalid macros. This would allow a wiki admin to get a list of items to check and correct.

UlrichB22 added a commit that referenced this issue May 22, 2024
macros with editing errors should not log tracebacks; fixes #1687
RogerHaase added a commit that referenced this issue May 27, 2024
cleanup macros with editing errors should not log tracebacks #1687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants