html2md_mcp_client 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46468e0870a51991423deb96277081f233006f39f3a265d33d35567c38bd64e9
|
|
4
|
+
data.tar.gz: 98c2d87ded5ff1d8b9641ac38f845f5912e622ee045a09930fc9169591f84bb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 040de8322dd8523f6adad126d63c10170e09b242401baf5388b1d2243c6d2ec8895ee9874a959d305445d179243de9fd77f3b98060e20080538c9b01ea473aec
|
|
7
|
+
data.tar.gz: 4cf6be14b86eda38382b75f35e17434d628d30dcf1b81425d211002da1e27b03cd08b01e15afa97bdad5e00e368bec6559bad2ef071ef8cdb0eea9d49180d98e
|
|
@@ -34,7 +34,9 @@ module Html2mdMcpClient
|
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
JSON.parse(body)
|
|
37
|
-
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH,
|
|
37
|
+
rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, Errno::ENETUNREACH,
|
|
38
|
+
Errno::ECONNRESET, Errno::ETIMEDOUT, Errno::EPIPE,
|
|
39
|
+
SocketError, Net::OpenTimeout, Net::ReadTimeout => e
|
|
38
40
|
raise ConnectionError, "Cannot connect to #{@uri}: #{e.message}"
|
|
39
41
|
rescue JSON::ParserError => e
|
|
40
42
|
raise ProtocolError, "Invalid JSON response: #{e.message}"
|
|
@@ -81,6 +81,41 @@ RSpec.describe Html2mdMcpClient::Transport::Http do
|
|
|
81
81
|
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
82
82
|
end
|
|
83
83
|
|
|
84
|
+
it 'raises ConnectionError on open timeout' do
|
|
85
|
+
stub_request(:post, url).to_raise(Net::OpenTimeout)
|
|
86
|
+
|
|
87
|
+
expect { transport.send_request({ jsonrpc: '2.0', id: 1, method: 'test', params: {} }) }
|
|
88
|
+
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
it 'raises ConnectionError on read timeout' do
|
|
92
|
+
stub_request(:post, url).to_raise(Net::ReadTimeout)
|
|
93
|
+
|
|
94
|
+
expect { transport.send_request({ jsonrpc: '2.0', id: 1, method: 'test', params: {} }) }
|
|
95
|
+
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
it 'raises ConnectionError on network unreachable' do
|
|
99
|
+
stub_request(:post, url).to_raise(Errno::ENETUNREACH)
|
|
100
|
+
|
|
101
|
+
expect { transport.send_request({ jsonrpc: '2.0', id: 1, method: 'test', params: {} }) }
|
|
102
|
+
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
it 'raises ConnectionError on connection reset' do
|
|
106
|
+
stub_request(:post, url).to_raise(Errno::ECONNRESET)
|
|
107
|
+
|
|
108
|
+
expect { transport.send_request({ jsonrpc: '2.0', id: 1, method: 'test', params: {} }) }
|
|
109
|
+
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
it 'raises ConnectionError on connection timed out' do
|
|
113
|
+
stub_request(:post, url).to_raise(Errno::ETIMEDOUT)
|
|
114
|
+
|
|
115
|
+
expect { transport.send_request({ jsonrpc: '2.0', id: 1, method: 'test', params: {} }) }
|
|
116
|
+
.to raise_error(Html2mdMcpClient::ConnectionError, /Cannot connect/)
|
|
117
|
+
end
|
|
118
|
+
|
|
84
119
|
it 'raises ProtocolError on invalid JSON' do
|
|
85
120
|
stub_request(:post, url).to_return(status: 200, body: 'not json')
|
|
86
121
|
|