From a7803ec3ca102f227dd4e2901bf58557efea36aa Mon Sep 17 00:00:00 2001 From: Mark Joshwel Date: Fri, 1 Sep 2023 13:54:43 +0000 Subject: [PATCH] surplus: remove unnecessary exceptions --- surplus.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/surplus.py b/surplus.py index 860c297..44fea5e 100644 --- a/surplus.py +++ b/surplus.py @@ -31,14 +31,12 @@ For more information, please refer to from argparse import ArgumentParser from collections import OrderedDict -from dataclasses import dataclass from sys import stderr, stdout from typing import ( Any, Callable, Final, Generic, - Literal, NamedTuple, TextIO, TypeAlias, @@ -117,18 +115,10 @@ OUTPUT_LINE_6_KEYS: Final[tuple[str, ...]] = ( # exceptions -class InvalidPlusCodeError(Exception): - ... - - class NoSuitableLocationError(Exception): ... -class InvalidQueryError(Exception): - ... - - # data structures ResultType = TypeVar("ResultType") @@ -262,10 +252,7 @@ class PlusCodeQuery(NamedTuple): except KeyError: return Result[Latlong]( - EMPTY_LATLONG, - error=InvalidPlusCodeError( - "Plus Code is not full-length, e.g, 6PH58QMF+FX" - ), + EMPTY_LATLONG, error="Plus Code is not full-length, e.g, 6PH58QMF+FX" ) except Exception as exc: