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

Simplify Axios Error in the log #1792

Closed
kelson42 opened this issue Feb 23, 2023 · 1 comment · Fixed by #1795
Closed

Simplify Axios Error in the log #1792

kelson42 opened this issue Feb 23, 2023 · 1 comment · Fixed by #1795

Comments

@kelson42
Copy link
Collaborator

When we have an Axios error, the log is too verbose, we get something like:

[error] [2023-02-03T03:13:40.230Z] Error downloading article World_History/The_Rise_of_Dictatorship_and_Totalitarianism/Quick_Quiz
Failed to run mwoffliner after [1441s]: {
	"message": "Request failed with status code 403",
	"name": "AxiosError",
	"stack": "AxiosError: Request failed with status code 403\n    at settle (file:///tmp/mwoffliner/node_modules/axios/lib/core/settle.js:19:12)\n    at IncomingMessage.handleStreamEnd (file:///tmp/mwoffliner/node_modules/axios/lib/adapters/http.js:512:11)\n    at IncomingMessage.emit (node:events:539:35)\n    at IncomingMessage.emit (node:domain:475:12)\n    at endReadableNT (node:internal/streams/readable:1344:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)",
	"config": {
		"transitional": {
			"silentJSONParsing": true,
			"forcedJSONParsing": true,
			"clarifyTimeoutError": false
		},
		"adapter": [
			"xhr",
			"http"
		],
		"transformRequest": [
			null
		],
		"transformResponse": [
			null
		],
		"timeout": 10000000,
		"xsrfCookieName": "XSRF-TOKEN",

and then come hundreds of line. This is not useful and brings problem, see openzim/zimfarm#751.

We should not have all this details (at least not what in the config part of the json... but actually I want a simple error with the HTTP error code and only the most important information.

@FledgeXu
Copy link
Contributor

Hi, I want to do this issue as my good first issue. Could you assign it to me?

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

Successfully merging a pull request may close this issue.

3 participants