@@ -11,8 +11,6 @@ function Backend({
11
11
parsers,
12
12
onauth,
13
13
onready,
14
- resolve,
15
- reject,
16
14
transform,
17
15
onnotice,
18
16
onnotify
@@ -85,11 +83,6 @@ function Backend({
85
83
break
86
84
}
87
85
}
88
-
89
- resolve ( backend . query . stream
90
- ? backend . query . result . count
91
- : backend . query . result
92
- )
93
86
}
94
87
95
88
function CopyDone ( ) { /* No handling needed */ }
@@ -126,17 +119,17 @@ function Backend({
126
119
function CopyData ( ) { /* No handling needed until implemented */ }
127
120
128
121
function ErrorResponse ( x ) {
129
- reject ( errors . generic ( error ( x ) ) )
122
+ backend . error = errors . generic ( error ( x ) )
130
123
}
131
124
132
125
/* c8 ignore next */
133
126
function CopyInResponse ( ) {
134
- reject ( errors . notSupported ( 'CopyInResponse' ) )
127
+ backend . error = errors . notSupported ( 'CopyInResponse' )
135
128
}
136
129
137
130
/* c8 ignore next */
138
131
function CopyOutResponse ( ) {
139
- reject ( errors . notSupported ( 'CopyOutResponse' ) )
132
+ backend . error = errors . notSupported ( 'CopyOutResponse' )
140
133
}
141
134
142
135
/* c8 ignore next */
@@ -160,7 +153,7 @@ function Backend({
160
153
try {
161
154
type !== 0 && onauth ( type , x )
162
155
} catch ( err ) {
163
- reject ( err )
156
+ backend . error = err
164
157
}
165
158
}
166
159
@@ -171,12 +164,12 @@ function Backend({
171
164
172
165
/* c8 ignore next */
173
166
function PortalSuspended ( ) {
174
- reject ( errors . notSupported ( 'PortalSuspended' ) )
167
+ backend . error = errors . notSupported ( 'PortalSuspended' )
175
168
}
176
169
177
170
/* c8 ignore next */
178
171
function ParameterDescription ( ) {
179
- reject ( errors . notSupported ( 'ParameterDescription' ) )
172
+ backend . error = errors . notSupported ( 'ParameterDescription' )
180
173
}
181
174
182
175
function RowDescription ( x ) {
@@ -206,21 +199,21 @@ function Backend({
206
199
207
200
/* c8 ignore next */
208
201
function FunctionCallResponse ( ) {
209
- reject ( errors . notSupported ( 'FunctionCallResponse' ) )
202
+ backend . error = errors . notSupported ( 'FunctionCallResponse' )
210
203
}
211
204
212
205
/* c8 ignore next */
213
206
function NegotiateProtocolVersion ( ) {
214
- reject ( errors . notSupported ( 'NegotiateProtocolVersion' ) )
207
+ backend . error = errors . notSupported ( 'NegotiateProtocolVersion' )
215
208
}
216
209
217
210
/* c8 ignore next */
218
211
function CopyBothResponse ( ) {
219
- reject ( errors . notSupported ( 'CopyBothResponse' ) )
212
+ backend . error = errors . notSupported ( 'CopyBothResponse' )
220
213
}
221
214
222
- function ReadyForQuery ( ) {
223
- onready ( )
215
+ function ReadyForQuery ( x ) {
216
+ onready ( backend . error )
224
217
}
225
218
}
226
219
0 commit comments