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

feat(Apple Music): introduce artist albums pagination #400

Merged
merged 2 commits into from
Dec 17, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
use util.format for debug stack reporting
  • Loading branch information
miraclx committed Dec 17, 2022
commit c8949d9e68502dfd7f80368f1d5bb1d506d7b92b
21 changes: 18 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
/* eslint-disable consistent-return, camelcase, prefer-promise-reject-errors */
import xurl from 'url';
import util from 'util';
import xpath from 'path';
import crypto from 'crypto';
import {spawn, spawnSync} from 'child_process';
Expand Down Expand Up @@ -250,7 +251,11 @@ async function processPromise(promise, logger, messageHandlers) {
if (messageHandlers.onErr !== false)
handleResultOf(result.reason(), messageHandlers.onErr, reason => [
'(failed%s)',
reason ? `: [${reason['SHOW_DEBUG_STACK' in process.env ? 'stack' : 'message'] || reason}]` : '',
reason
? `: [${
'SHOW_DEBUG_STACK' in process.env ? util.formatWithOptions({colors: true}, reason) : reason['message'] || reason
}]`
: '',
'\n',
]);
return null;
Expand Down Expand Up @@ -1602,7 +1607,13 @@ async function init(packageJson, queries, options) {
`\u2022 [\u2715] ${trackStat.meta && trackStat.meta.trackName ? `${trackStat.meta.trackName}` : '<unknown track>'}${
trackStat.meta && trackStat.meta.track.uri ? ` [${trackStat.meta.track.uri}]` : ''
} (failed:${reason ? ` ${reason}` : ''}${
trackStat.err ? ` [${trackStat.err['SHOW_DEBUG_STACK' in process.env ? 'stack' : 'message'] || trackStat.err}]` : ''
trackStat.err
? ` [${
'SHOW_DEBUG_STACK' in process.env
? util.formatWithOptions({colors: true}, trackStat.err)
: trackStat.err['message'] || trackStat.err
}]`
: ''
})`,
);
} else if (trackStat[symbols.errorCode] === 0)
Expand Down Expand Up @@ -2168,7 +2179,11 @@ async function main(argv) {
} catch (err) {
console.error(
`\x1b[31m[!] Fatal Error\x1b[0m: ${
typeof err === 'undefined' ? '[uncaught]' : err ? err['SHOW_DEBUG_STACK' in process.env ? 'stack' : 'message'] : err
typeof err === 'undefined'
? '[uncaught]'
: 'SHOW_DEBUG_STACK' in err
? util.formatWithOptions({colors: true}, err)
: err['message']
}`,
);
}
Expand Down