Skip to content

Catch value errors#87

Merged
tintoy merged 1 commit intotintoy:masterfrom
speedplane:master
May 7, 2025
Merged

Catch value errors#87
tintoy merged 1 commit intotintoy:masterfrom
speedplane:master

Conversation

@speedplane
Copy link
Contributor

@speedplane speedplane commented May 7, 2025

Which can occur if the logs have uneven brackets due to unescaped input.

  File   File "C:\Users\micha\Documents\LPWork\MVP\src\PyScripts\aicore\pipeline.py", line 248, in run_method
    logger.error(f"Exception in {req.ai.code()}: {e}")
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 1548, in error
    self._log(ERROR, msg, args, **kwargs)
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\micha\AppData\Roaming\Python\Python313\site-packages\seqlog\structured_logging.py", line 221, in _log
    super()._log(level, msg, args, exc_info, extra, stack_info, stacklevel=2)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 1664, in _log
    self.handle(record)
    ~~~~~~~~~~~^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 1680, in handle
    self.callHandlers(record)
    ~~~~~~~~~~~~~~~~~^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 1736, in callHandlers
    hdlr.handle(record)
    ~~~~~~~~~~~^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 1026, in handle
    self.emit(record)
    ~~~~~~~~~^^^^^^^^
  File "C:\Users\micha\AppData\Roaming\Python\Python313\site-packages\seqlog\structured_logging.py", line 318, in emit
    msg = self.format(record)
  File "C:\Python313\Lib\logging\__init__.py", line 998, in format
    return fmt.format(record)
           ~~~~~~~~~~^^^^^^^^
  File "C:\Python313\Lib\logging\__init__.py", line 711, in format
    record.message = record.getMessage()
                     ~~~~~~~~~~~~~~~~~^^
  File "C:\Users\micha\AppData\Roaming\Python\Python313\site-packages\seqlog\structured_logging.py", line 160, in getMessage
    return self.msg.format(**self.log_props)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
ValueError: Single '}' encountered in format string line 248, in run_method

@tintoy tintoy merged commit f1e1131 into tintoy:master May 7, 2025
4 checks passed
@tintoy
Copy link
Owner

tintoy commented May 7, 2025

Thanks!

@tintoy tintoy self-assigned this May 11, 2025
@tintoy
Copy link
Owner

tintoy commented May 11, 2025

Published v0.4.1.

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

Successfully merging this pull request may close these issues.

2 participants