@@ 64-73 (lines=10) @@ | ||
61 | * @param array $options |
|
62 | * @return CancellablePromiseInterface |
|
63 | */ |
|
64 | public function post(ResponseInterface $response, string $transactionId, array $options = []): CancellablePromiseInterface |
|
65 | { |
|
66 | $this->stdout->write(self::HR); |
|
67 | $this->stdout->write($transactionId . ': response' . PHP_EOL); |
|
68 | $this->stdout->write(self::HR); |
|
69 | $this->stdout->write('Status: ' . $response->getStatusCode() . PHP_EOL); |
|
70 | $this->stdout->write(self::HR); |
|
71 | ||
72 | return resolve($response); |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * Deal with possible errors that occurred during request/response events. |
|
@@ 83-92 (lines=10) @@ | ||
80 | * @param array $options |
|
81 | * @return CancellablePromiseInterface |
|
82 | */ |
|
83 | public function error(Throwable $throwable, string $transactionId, array $options = []): CancellablePromiseInterface |
|
84 | { |
|
85 | $this->stdout->write(self::HR); |
|
86 | $this->stdout->write($transactionId . ': error' . PHP_EOL); |
|
87 | $this->stdout->write(self::HR); |
|
88 | $this->stdout->write((string)$throwable); |
|
89 | $this->stdout->write(self::HR); |
|
90 | ||
91 | return reject($throwable); |
|
92 | } |
|
93 | } |
|
94 |