Coverage for jsonsubschema/exceptions.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1'''
2Created on May 11, 2020
3@author: Andrew Habib
4'''
7class _Error(Exception):
8 pass
11class UnsupportedRecursiveRef(_Error):
12 def __init__(self, schema, which_side):
13 self.schema = schema
14 self.which_side = which_side
16 def __str__(self):
17 return f'Recursive schemas are not supported. {self.which_side} is recursive.'
20class UnsupportedEnumCanonicalization(_Error):
22 def __init__(self, tau, schema):
23 self.tau = tau
24 self.schema = schema
27 def __str__(self):
28 return f'Canonicalizing an enum schema of type {self.tau} is not supported.'
31# class UnsupportedSchemaType(_Error):
32# '''
33# Probably this is not required since custom types are not
34# supported by jsonschema validation anyways; so we will not reat
35# a case that uses this exception.'''
37# def __init__(self, schema, tau):
38# self.schema = schema
39# self.tau = tau
41# def __str__(self):
42# return '{} is unsupported jsonschema type in schema: {}'.format(self.tau, self.schema)
45# class UnsupportedSubtypeChecker(_Error):
47# def __init__(self, schema, desc):
48# self.schema = schema
49# self.desc = desc
51# def __str__(self):
52# return '{} is unsupported. Schema: {}'.format(self.desc, self.schema)