MCPcopy Index your code
hub / github.com/MagicStack/asyncpg / new

Method new

asyncpg/exceptions/_base.py:282–299  ·  view source on GitHub ↗
(cls, fields, query=None)

Source from the content-addressed store, hash-verified

280
281 @classmethod
282 def new(cls, fields, query=None):
283 exccls, message_text, dct = cls._make_constructor(fields, query)
284
285 if exccls is UnknownPostgresError:
286 exccls = PostgresLogMessage
287
288 if exccls is PostgresLogMessage:
289 severity = dct.get('severity_en') or dct.get('severity')
290 if severity and severity.upper() == 'WARNING':
291 exccls = asyncpg.PostgresWarning
292
293 if issubclass(exccls, (BaseException, Warning)):
294 msg = exccls(message_text)
295 else:
296 msg = exccls()
297
298 msg.__dict__.update(dct)
299 return msg

Callers

nothing calls this directly

Calls 3

_make_constructorMethod · 0.80
getMethod · 0.80
upperMethod · 0.80

Tested by

no test coverage detected