Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Show url when axios error is thrown #1132

Closed
alwyn974 opened this issue Apr 26, 2024 · 2 comments
Closed

[Feature]: Show url when axios error is thrown #1132

alwyn974 opened this issue Apr 26, 2024 · 2 comments

Comments

@alwyn974
Copy link

alwyn974 commented Apr 26, 2024

Hello, is it possible to display the url when an error is generated by axios?
Because I've just had this error and it wasn't obvious that the error came from a bad ssl of an image url.

Report "2025_PLD_EnVRonment" render failed.

Error while executing docx recipe
(because) write EPROTO 0077977D517F0000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1590:SSL alert number 80

Error: write EPROTO 0077977D517F0000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1590:SSL alert number 80

  at AxiosError.from (/app/node_modules/@jsreport/jsreport-docx/node_modules/axios/dist/node/axios.cjs:837:14)
  at RedirectableRequest.handleRequestError (/app/node_modules/@jsreport/jsreport-docx/node_modules/axios/dist/node/axios.cjs:3087:25)
  at RedirectableRequest.emit (node:events:517:28)
  at eventHandlers.<computed> (/app/node_modules/follow-redirects/index.js:38:24)
  at ClientRequest.emit (node:events:517:28)
  at TLSSocket.socketErrorListener (node:_http_client:501:9)
  at TLSSocket.emit (node:events:517:28)
  at emitErrorNT (node:internal/streams/destroy:151:8)
  at emitErrorCloseNT (node:internal/streams/destroy:116:3)
  at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
  at Axios.request (/app/node_modules/@jsreport/jsreport-docx/node_modules/axios/dist/node/axios.cjs:3877:41)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async resolveImageSrc (/app/node_modules/@jsreport/jsreport-docx/lib/imageUtils.js:31:24)
  at async processImage (/app/node_modules/@jsreport/jsreport-docx/lib/postprocess/processImage.js:148:24)
  at async processDrawingEl (/app/node_modules/@jsreport/jsreport-docx/lib/postprocess/drawingObject.js:98:31)
  at async /app/node_modules/@jsreport/jsreport-docx/lib/postprocess/drawingObject.js:40:28
wrapped by:
Error: Error while executing docx recipe
(because) write EPROTO 0077977D517F0000:error:0A000438:SSL routines:ssl3_read_bytes:tlsv1 alert internal error:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1590:SSL alert number 80

  at module.exports (/app/node_modules/@jsreport/jsreport-core/lib/shared/createError.js:10:13)
  at WorkerReporter.createError (/app/node_modules/@jsreport/jsreport-core/lib/shared/reporter.js:53:12)
  at module.exports (/app/node_modules/@jsreport/jsreport-docx/lib/processDocx.js:117:20)
  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  at async module.exports (/app/node_modules/@jsreport/jsreport-docx/lib/recipe.js:35:28)
  at async invokeRender (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:93:5)
  at async WorkerReporter._render (/app/node_modules/@jsreport/jsreport-core/lib/worker/render/render.js:148:7)
  at async /app/node_modules/@jsreport/jsreport-core/lib/worker/reporter.js:227:24
  at async processAndResponse (/app/node_modules/@jsreport/advanced-workers/lib/workerHandler.js:41:17)
@bjrmatos
Copy link
Collaborator

hi! can you share a demo of this error on the playground? i will try to see what we can do about it

@alwyn974
Copy link
Author

Here the playground link with the same ssl error https://playground.jsreport.net/w/anon/m7er9Gza.
But you can try with any invalid url to have an error from Axios like:

The url should be available in the error object with _currentUrl or config.url from here https://github.com/jsreport/jsreport/blob/master/packages/jsreport-docx/lib/imageUtils.js#L64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants