schema_salad.exceptions

Shared Exception classes.

Exceptions

SchemaSaladException

Base class for all schema-salad exceptions.

SchemaException

Indicates error with the provided schema definition.

ValidationException

Indicates error with document against the provided schema.

ClassValidationException

Indicates error with document against the provided schema.

Classes

SourceLine

Functions

reflow_all(text[, maxline])

strip_duplicated_lineno(text)

Strip duplicated line numbers.

to_one_line_messages(exc)

Module Contents

class schema_salad.exceptions.SourceLine(item, key=None, raise_type=str, include_traceback=False)
Parameters:
  • item (Any)

  • key (Optional[Any])

  • raise_type (Callable[[str], Any])

  • include_traceback (bool)

__enter__()
Return type:

SourceLine

__exit__(exc_type, exc_value, tb)
Parameters:
  • exc_type (Any)

  • exc_value (Any)

  • tb (Any)

Return type:

None

file()
Return type:

Optional[str]

start()
Return type:

Optional[Tuple[int, int]]

end()
Return type:

Optional[Tuple[int, int]]

makeLead()
Return type:

str

makeError(msg)
Parameters:

msg (str)

Return type:

Any

schema_salad.exceptions.reflow_all(text, maxline=None)
Parameters:
  • text (str)

  • maxline (Optional[int])

Return type:

str

schema_salad.exceptions.strip_duplicated_lineno(text)

Strip duplicated line numbers.

Same as strip_dup_lineno() but without reflow.

Parameters:

text (str)

Return type:

str

exception schema_salad.exceptions.SchemaSaladException(msg, sl=None, children=None, bullet_for_children='')

Bases: Exception

digraph inheritancec785f3f71d { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "SchemaSaladException" [URL="#schema_salad.exceptions.SchemaSaladException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all schema-salad exceptions."]; }

Base class for all schema-salad exceptions.

Parameters:
propagate_sourceline()
Return type:

None

as_warning()
Return type:

SchemaSaladException

with_sourceline(sl)
Parameters:

sl (Optional[schema_salad.sourceline.SourceLine])

Return type:

SchemaSaladException

leaves()
Return type:

List[SchemaSaladException]

prefix()
Return type:

str

summary(level=0, with_bullet=False)
Parameters:
Return type:

str

__str__()

Convert to a string using pretty_str().

Return type:

str

pretty_str(level=0)
Parameters:

level (int)

Return type:

str

exception schema_salad.exceptions.SchemaException(msg, sl=None, children=None, bullet_for_children='')

Bases: SchemaSaladException

digraph inheritance39122d3403 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "SchemaException" [URL="#schema_salad.exceptions.SchemaException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Indicates error with the provided schema definition."]; "SchemaSaladException" -> "SchemaException" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SchemaSaladException" [URL="#schema_salad.exceptions.SchemaSaladException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all schema-salad exceptions."]; }

Indicates error with the provided schema definition.

Parameters:
exception schema_salad.exceptions.ValidationException(msg, sl=None, children=None, bullet_for_children='')

Bases: SchemaSaladException

digraph inheritance12502e6bbe { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "SchemaSaladException" [URL="#schema_salad.exceptions.SchemaSaladException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all schema-salad exceptions."]; "ValidationException" [URL="#schema_salad.exceptions.ValidationException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Indicates error with document against the provided schema."]; "SchemaSaladException" -> "ValidationException" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Indicates error with document against the provided schema.

Parameters:
exception schema_salad.exceptions.ClassValidationException(msg, sl=None, children=None, bullet_for_children='')

Bases: ValidationException

digraph inheritanceb7f51938a5 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ClassValidationException" [URL="#schema_salad.exceptions.ClassValidationException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ValidationException" -> "ClassValidationException" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SchemaSaladException" [URL="#schema_salad.exceptions.SchemaSaladException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Base class for all schema-salad exceptions."]; "ValidationException" [URL="#schema_salad.exceptions.ValidationException",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Indicates error with document against the provided schema."]; "SchemaSaladException" -> "ValidationException" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Indicates error with document against the provided schema.

Parameters:
schema_salad.exceptions.to_one_line_messages(exc)
Parameters:

exc (SchemaSaladException)

Return type:

str