@@ -46,19 +46,10 @@ def __str__(self) -> str:
4646 return self .__doc__
4747
4848 def _help (self ) -> str :
49- # FIXME: Indentation hell
50- prefix = '\n ' + ' ' * 14
51- context = prefix .join (str (self .args ))
52- if context :
53- context = '{prefix}{context}\n ' .format (prefix = prefix , context = context )
54-
5549 return """
5650 An unexpected error has occurred!
57- {context}
58- Please file a bug report at https://github.com/dipdup-net/dipdup/issues and attach the following:
5951
60- * `dipdup.yml` config. Make sure to remove sensitive information.
61- * Reasonable amount of logs before the crash.
52+ Please file a bug report at https://github.com/dipdup-net/dipdup/issues
6253 """
6354
6455 def help (self ) -> str :
@@ -79,7 +70,7 @@ def _help(self) -> str:
7970 return f"""
8071 `{ self .datasource } ` datasource returned an error: { self .msg }
8172
82- Most likely, this is a DipDup bug. Please file a bug report at https://github.com/dipdup-net/dipdup/issues
73+ Please file a bug report at https://github.com/dipdup-net/dipdup/issues
8374 """
8475
8576
@@ -93,7 +84,7 @@ def _help(self) -> str:
9384 return f"""
9485 { self .msg }
9586
96- DipDup config reference: https://docs.dipdup.net/config-file-reference
87+ DipDup config reference: https://docs.dipdup.net/config
9788 """
9889
9990
@@ -107,11 +98,11 @@ def _help(self) -> str:
10798 return f"""
10899 { self .msg }
109100
110- Model: `{ self .model .__class__ .__name__ } `
101+ Model: `{ self .model ._meta . _model .__name__ } `
111102 Table: `{ self .model ._meta .db_table } `
112103
113104 Tortoise ORM examples: https://tortoise-orm.readthedocs.io/en/latest/examples.html
114- DipDup config reference: https://docs.dipdup.net/config-file-reference /database
105+ DipDup config reference: https://docs.dipdup.net/config/database
115106 """
116107
117108
@@ -177,6 +168,8 @@ def _help(self) -> str:
177168
178169@dataclass (repr = False )
179170class InitializationRequiredError (DipDupError ):
171+ """Project initialization required"""
172+
180173 message : str
181174
182175 def _help (self ) -> str :
@@ -198,23 +191,22 @@ class HandlerImportError(DipDupError):
198191 obj : Optional [str ] = None
199192
200193 def _help (self ) -> str :
201- what = f'`{ self .obj } ` from ' if self .obj else ''
194+ what = f'`{ self .obj } ` from' if self .obj else ''
202195 return f"""
203196 Failed to import { what } module `{ self .module } `.
204197
205198 Reasons in order of possibility:
206199
207- 1. `init` command was not called after modifying config
208- 2. Name of handler module and handler function inside it don't match
209- 2. Invalid `package` config value, reusing name of existing package
210- 3. Something's wrong with PYTHONPATH env variable
211-
200+ 1. `init` command was not called after modifying config
201+ 2. Name of handler module and handler function inside it don't match
202+ 3. Invalid `package` config value, reusing name of existing package
203+ 4. Something's wrong with `PYTHONPATH` env variable
212204 """
213205
214206
215207@dataclass (repr = False )
216208class ContractAlreadyExistsError (DipDupError ):
217- """Attemp to add a contract with alias or address which is already in use"""
209+ """Attempt to add a contract with alias or address already in use"""
218210
219211 ctx : Any
220212 name : str
@@ -238,7 +230,7 @@ def _help(self) -> str:
238230
239231@dataclass (repr = False )
240232class IndexAlreadyExistsError (DipDupError ):
241- """Attemp to add an index with alias which is already in use"""
233+ """Attemp to add an index with an alias already in use"""
242234
243235 ctx : Any
244236 name : str
@@ -292,9 +284,9 @@ class CallbackError(DipDupError):
292284
293285 def _help (self ) -> str :
294286 return f"""
295- `{ self .module } ` callback execution failed.
287+ `{ self .module } ` callback execution failed:
296288
297- { self .exc .__class__ .__name__ } { self .exc }
289+ { self .exc .__class__ .__name__ } : { self .exc }
298290
299291 Eliminate the reason of failure and restart DipDup.
300292 """
@@ -331,7 +323,9 @@ class HasuraError(DipDupError):
331323
332324 def _help (self ) -> str :
333325 return f"""
334- Failed to configure Hasura: { self .msg }
326+ Failed to configure Hasura:
327+
328+ { self .msg }
335329
336330 Check out Hasura logs for more information.
337331
0 commit comments