Newer
Older
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
;;; Free Software published under an MIT-like license. See LICENSE ;;;
;;; ;;;
;;; Copyright (c) 2012 Google, Inc. All rights reserved. ;;;
;;; ;;;
;;; Original author: Ben Wagner ;;;
;;; ;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package "PROTO-IMPL")
;;; Protocol buffers conditions
(define-condition undefined-type (simple-error)
((type-name :type string
:reader error-type-name
:initarg :type-name
:documentation "The name of the type which can not be found."))
(:documentation "Indicates that a schema references a type which has not been defined.")
(:default-initargs :format-control "Undefined type:")
(:report (lambda (condition stream)
(format stream "~? ~s"
(simple-condition-format-control condition)
(simple-condition-format-arguments condition)
(error-type-name condition)))))
(define-condition undefined-field-type (undefined-type)
((field :type protobuf-field
:reader error-field
:initarg :field
:documentation "The field whose type is TYPE-NAME."))
(:documentation "Indicates that a schema contains a message with a field whose type is not a
primitive type and is not a known message (or extend) or enum.")
(:report (lambda (condition stream)
(format stream "~? Field ~s in message ~s has unknown type ~s."
(simple-condition-format-control condition)
(simple-condition-format-arguments condition)
(error-field condition)
(proto-parent (error-field condition))
(error-type-name condition)))))
(define-condition undefined-method-type (undefined-type)
((method :type protobuf-method
:reader error-method
:initarg :method
:documentation "The method that references TYPE-NAME.")
(where :type string
:reader error-where
:initarg :where
:documentation "Description of which type referenced by the method is undefined."))
(:documentation "Superclass for `undefined-type' errors related to a `protobuf-method'. Indicates
that a schema contains a service with a method whose input, output, or stream
type is not a known message (or extend).")
(:report (lambda (condition stream)
(format stream "~? ~a type for rpc ~s in service ~s has unknown type ~s."
(simple-condition-format-control condition)
(simple-condition-format-arguments condition)
(error-where condition)
(error-method condition)
(proto-parent (error-method condition))
(error-type-name condition)))))
(define-condition undefined-input-type (undefined-method-type)
()
(:default-initargs :where "Input"))
(define-condition undefined-output-type (undefined-method-type)
()
(:default-initargs :where "Output"))
(define-condition undefined-stream-type (undefined-method-type)
()
(:default-initargs :where "Stream"))