jrnl/jrnl/exception.py
Jonathan Wren c1eb0c54a3
Add type-checking plugin to linting checks (#1629)
* add type-checking plugin for flakeheaven

* update lock file

* fix type-checking issues in current codebase

* run linters
2022-11-03 07:18:35 -07:00

20 lines
471 B
Python

# Copyright © 2012-2022 jrnl contributors
# License: https://www.gnu.org/licenses/gpl-3.0.html
from typing import TYPE_CHECKING
from jrnl.output import print_msg
if TYPE_CHECKING:
from jrnl.messages import Message
class JrnlException(Exception):
"""Common exceptions raised by jrnl."""
def __init__(self, *messages: "Message"):
self.messages = messages
def print(self) -> None:
for msg in self.messages:
print_msg(msg)