Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

""" 

Module containing exceptions thrown by :mod:`dxf`. 

""" 

 

class DXFError(Exception): 

""" 

Base exception class for all dxf errors 

""" 

 

class DXFUnexpectedError(DXFError): 

""" 

Unexpected value error 

""" 

def __init__(self, got, expected): 

""" 

:param got: Actual value received 

:param expected: Value that was expected 

""" 

super(DXFUnexpectedError, self).__init__() 

self.got = got 

self.expected = expected 

 

class DXFUnexpectedStatusCodeError(DXFUnexpectedError): 

""" 

Unexpected HTTP status code 

""" 

def __str__(self): 

return 'expected status code %d, got %d' % (self.expected, self.got) 

 

class DXFDigestMismatchError(DXFUnexpectedError): 

""" 

Digest didn't match expected value 

""" 

def __str__(self): 

return 'expected digest %s, got %s' % (self.expected, self.got) 

 

class DXFUnexpectedKeyTypeError(DXFUnexpectedError): 

""" 

Cryptographic key type not supported 

""" 

def __str__(self): 

return 'expected key type %s, got %s' % (self.expected, self.got) 

 

class DXFUnexpectedDigestMethodError(DXFUnexpectedError): 

""" 

Digest method not supported 

""" 

def __str__(self): 

return 'expected digest method %s, got %s' % (self.expected, self.got) 

 

class DXFDisallowedSignatureAlgorithmError(DXFError): 

""" 

Signature algorithm forbidden 

""" 

def __init__(self, alg): 

""" 

:param alg: Forbidden signature algorithm 

:type alg: str 

""" 

super(DXFDisallowedSignatureAlgorithmError, self).__init__() 

self.alg = alg 

 

def __str__(self): 

return 'disallowed signature algorithm: %s' % self.alg 

 

class DXFSignatureChainNotImplementedError(DXFError): 

""" 

Signature chains not supported 

""" 

def __str__(self): 

return 'verification with a cert chain is not implemented' 

 

class DXFUnauthorizedError(DXFError): 

""" 

Registry returned authorized error 

""" 

def __str__(self): 

return 'unauthorized' 

 

class DXFAuthInsecureError(DXFError): 

""" 

Can't authenticate over insecure (non-HTTPS) connection 

""" 

def __str__(self): 

return 'Auth requires HTTPS' 

 

class DXFDigestNotAvailableForSchema1(DXFError): 

""" 

https://github.com/docker/distribution/issues/1662#issuecomment-213101772 

A schema1 manifest should always produce the same image id but defining the 

steps to produce directly from the manifest is not straight forward." 

""" 

def __str__(self): 

return 'Schema 1 manifest has no configuration blob. See https://github.com/docker/distribution/issues/1662#issuecomment-213101772'