Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion packages/input_schema/src/intl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ const intlStrings = {
'inputSchema.validation.proxyGroupMustBeArrayOfStrings':
'Field {rootName}.{fieldKey}.apifyProxyGroups must be an array of strings.',
};
/* eslint-enable max-len,quotes,quote-props */

/**
* Helper function to simulate intl formatMessage function
Expand Down
13 changes: 6 additions & 7 deletions packages/log/src/logger_text.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import c from 'ansi-colors';
import { inspect } from 'node:util';
import { Logger } from './logger';
import { LEVEL_TO_STRING, LogLevel, PREFIX_DELIMITER } from './log_consts';

Expand Down Expand Up @@ -80,16 +79,16 @@ export class LoggerText extends Logger {
// NOTE: Reason is here to support Meteor.js like errors.
const errorString = exception.stack || exception.reason || exception.toString();
const errorLines = errorString.split('\n');
const causeString = exception.cause
? inspect(exception.cause, { colors: true, maxArrayLength: 20 }) : null;
// const causeString = exception.cause
// ? inspect(exception.cause, { colors: true, maxArrayLength: 20 }) : null;

// Add details to a first line.
if (errDetails.length) errorLines[0] += c.gray(`(details: ${errDetails.join(', ')})`);

if (causeString) {
const causeLines = causeString.split('\n');
errorLines.push(c.gray(`Cause: ${causeLines[0]}`), ...causeLines.slice(1).map((line) => ` ${line}`));
}
// if (causeString) {
// const causeLines = causeString.split('\n');
// errorLines.push(c.gray(`Cause: ${causeLines[0]}`), ...causeLines.slice(1).map((line) => ` ${line}`));
// }

// Compose it back.
errStack = errorLines.map((line) => ` ${line}`).join('\n');
Expand Down
2 changes: 1 addition & 1 deletion test/logger_text.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('loggerText', () => {

// Only Node16+ supports cause
if (!process.version.startsWith('v14')) {
it('should log cause for errors', () => {
it.skip('should log cause for errors', () => {
const causeError = new Error('hello world!');
const actualError = new Error('some error', { cause: causeError });

Expand Down