Custom exceptions for PyOngc

Exceptions for PyONGC.

exception pyongc.exceptions.InvalidCoordinates(text: str | None = None)

Raised when coordinates are not valid.

Maybe you’re passing an object without registered coordinates (typically an Unknown object) to some function; or you input coordinates as text in a wrong format: to be recognized the input text must be in the format HH:MM:SS.ss +/-DD:MM:SS.s.

exception pyongc.exceptions.ObjectNotFound(name: str | None = None)

Raised when a valid object identifier isn’t found in the database.

The identifier is recognized to be part of one of the supported catalogs, but the object isn’t in the database (or doesn’t exist at all).

For example, pyongc.Dso(‘NGC7000A’) is valid, but it doesn’t exist.

exception pyongc.exceptions.UnknownIdentifier(text: str | None = None)

Raised when input text can’t be recognized as a valid object identifier.

You’re asking for an identifier using the wrong format, or using an identifier which refers to a catalog not supported by PyOngc.