summaryrefslogtreecommitdiff
path: root/wrappers/python/eduvpncommon/error.py
blob: ce0cec1f30181c4c1a885c0c48a22ada199e56dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from enum import Enum

class GoError(Exception):
    message_dict: dict
    code: Enum

    def __init__(self, err: Enum, messages: dict):
        assert err
        self.code = err
        self.message_dict = messages

    def __str__(self):
        return self.message_dict[self.code]