Open NikitaIT opened 2 years ago
When I run this command the Playground.svg
file is generated without error. Adding additional error handling makes sense but not sure it will address the error seen here. Do you see the http request fail for requestImageFile
?
@bafolts I tried on a project with a puml of 8000 lines. Now I wrote a small example that can be run in the console.
script.js
#!/usr/bin/env node
const http = require('http');
const okLen = 10; // ok if <= 92
const errorLen = 93; // ECONNRESET if >= 93
const extension = 'svg';
http.get({
host: 'www.plantuml.com',
path: `/plantuml/${extension}/${encodeURI(input().repeat(errorLen))}`,
});
function input() {
return `
class LinkedListItem<T> {
+item: T
+next: LinkedListItem<T>
}
`;
}
Run:
node ./script.js
I/O
In:
Out:
It is clear that this is not a mistake on your part. However, it would be nice to write something meaningful in addition to the log.
Proposed solution:
1) Check URL maxlength and assert (414 Request-URI Too Large). https://github.com/bafolts/tplant/blob/f54c1def872ce9e4b12a38151ba3f63015fd8f88/src/index.ts#L145 2) Handle ECONNRESET or add description about diagram size.