# Generated by tools/gen_errorcodes.nim. DO NOT EDIT!

when not defined(nimony):
  import errorcodes

proc windowsToErrorCode*(err: int32): ErrorCode =
  if err == 0'i32:
    Success
  elif err == 534'i32:
    OverflowError
  elif err == 1124'i32:
    Failure
  elif err == 1413'i32:
    IndexError
  elif err == 1745'i32 or err == 1781'i32 or err == 5913'i32 or err == 6604'i32 or err == 8322'i32 or err == 14090'i32 or err == 14091'i32 or err == 15038'i32:
    RangeError
  elif err == 123'i32:
    SyntaxError
  elif err == 8'i32 or err == 13859'i32:
    OutOfMemError
  elif err == 39'i32 or err == 1632'i32 or err == 4314'i32:
    DiskFullError
  elif err == 1001'i32:
    StackOverflow
  elif err == 1117'i32:
    IOError
  elif err == 1639'i32 or err == 10022'i32:
    ValueError
  elif err == 1010'i32 or err == 1018'i32 or err == 1169'i32 or err == 1409'i32 or err == 9017'i32 or err == 14007'i32 or err == 14075'i32:
    KeyError
  elif err == 38'i32 or err == 1100'i32 or err == 1129'i32:
    EndOfStreamError
  elif err == 625'i32:
    SkipError
  elif err == 61'i32 or err == 277'i32 or err == 794'i32 or err == 1502'i32 or err == 4322'i32 or err == 10055'i32 or err == 15083'i32:
    FullError
  elif err == 4306'i32:
    EmptyError
  elif err == 54'i32 or err == 1723'i32 or err == 5909'i32 or err == 7024'i32 or err == 8015'i32 or err == 8206'i32 or err == 8438'i32:
    BusyError
  elif err == 155'i32 or err == 89'i32:
    ResourceExhaustedError
  elif err == 4'i32 or err == 36'i32:
    DescriptorExhaustedError
  elif err == 5'i32 or err == 10013'i32:
    PermissionDenied
  elif err == 1237'i32:
    RetryError
  elif err == 258'i32 or err == 1053'i32 or err == 1121'i32 or err == 1460'i32 or err == 7040'i32 or err == 10060'i32:
    TimeoutError
  elif err == 10004'i32:
    InterruptedError
  elif err == 1131'i32:
    DeadlockError
  elif err == 33'i32 or err == 108'i32 or err == 212'i32 or err == 717'i32 or err == 1055'i32 or err == 1440'i32 or err == 5960'i32:
    LockedError
  elif err == 10048'i32 or err == 10056'i32:
    AlreadyConnected
  elif err == 55'i32 or err == 64'i32:
    AddressNotAvailable
  elif err == 1763'i32:
    AddressFamilyUnsupported
  elif err == 50'i32 or err == 120'i32 or err == 334'i32 or err == 335'i32 or err == 336'i32 or err == 632'i32 or err == 1764'i32 or err == 6834'i32:
    BadOperation
  elif err == 10053'i32 or err == 995'i32 or err == 1235'i32 or err == 1818'i32:
    AbortedOperation
  elif err == 1791'i32 or err == 4056'i32 or err == 10036'i32 or err == 10037'i32:
    AlreadyInProgress
  elif err == 111'i32 or err == 206'i32 or err == 8348'i32 or err == 10063'i32 or err == 15121'i32:
    NameTooLong
  elif err == 183'i32 or err == 1250'i32:
    NameExists
  elif err == 1743'i32 or err == 8349'i32:
    ContentTooLong
  elif err == 6'i32:
    BadDescriptor
  elif err == 11'i32:
    BadExecutable
  elif err == 1142'i32:
    BadLink
  elif err == 10041'i32 or err == 10042'i32 or err == 10043'i32 or err == 10044'i32:
    BadProtocol
  elif err == 19'i32:
    ReadonlyProtection
  elif err == 487'i32:
    SegFault
  elif err == 276'i32 or err == 323'i32 or err == 634'i32 or err == 1392'i32 or err == 1393'i32 or err == 1500'i32 or err == 6843'i32 or err == 9572'i32:
    DiskCorruption
  elif err == 10050'i32 or err == 10051'i32 or err == 10052'i32 or err == 10053'i32 or err == 10054'i32:
    Disconnected
  elif err == 10061'i32:
    RefusedConnection
  elif err == 10065'i32:
    UnreachableHost
  else:
    Failure

proc errorCodeToWindows*(err: ErrorCode): int32 =
  case err
  of Success: 0'i32
  of OverflowError: 534'i32
  of Failure: 1124'i32
  of IndexError: 1413'i32
  of RangeError: 1745'i32
  of SyntaxError: 123'i32
  of OutOfMemError: 8'i32
  of DiskFullError: 39'i32
  of StackOverflow: 1001'i32
  of IOError: 1117'i32
  of ValueError: 1639'i32
  of KeyError: 1010'i32
  of EndOfStreamError: 38'i32
  of SkipError: 625'i32
  of FullError: 61'i32
  of EmptyError: 4306'i32
  of BusyError: 54'i32
  of ResourceExhaustedError: 155'i32
  of DescriptorExhaustedError: 4'i32
  of PermissionDenied: 5'i32
  of RetryError: 1237'i32
  of TimeoutError: 258'i32
  of InterruptedError: 10004'i32
  of DeadlockError: 1131'i32
  of LockedError: 33'i32
  of AlreadyConnected: 10048'i32
  of AddressNotAvailable: 55'i32
  of AddressFamilyUnsupported: 1763'i32
  of BadOperation: 50'i32
  of AbortedOperation: 10053'i32
  of AlreadyInProgress: 1791'i32
  of NameTooLong: 111'i32
  of NameExists: 183'i32
  of ContentTooLong: 1743'i32
  of BadDescriptor: 6'i32
  of BadExecutable: 11'i32
  of BadLink: 1142'i32
  of BadProtocol: 10041'i32
  of ReadonlyProtection: 19'i32
  of SegFault: 487'i32
  of DiskCorruption: 276'i32
  of Disconnected: 10050'i32
  of RefusedConnection: 10061'i32
  of UnreachableHost: 10065'i32
  else: 1124'i32
