MSXKeyError#

module wntr.epanet.msx.exceptions

exception MSXKeyError[source]#

Bases: EpanetMsxException, KeyError

__init__(code, name, *args, line_num=None, line=None)[source]#

MSX-specific error that is due to a missing or unacceptably named variable/speces/etc.

Parameters:
  • code (int or str or MSXErrors) – EPANET-MSX error code (int) or a string mapping to the MSXErrors enum members

  • name (str) – Key/name/id that is missing

  • args (additional non-keyword arguments, optional) – If there is a string-format within the error code’s text, these will be used to replace the format, otherwise they will be output at the end of the Exception message.

  • line_num (int, optional) – Line number, if reading an INP file, by default None

  • line (str, optional) – Contents of the line, by default None

__new__(**kwargs)#