Skip to content

Commit 1772b9d

Browse files
authored
refactor: simplify generate:manifest error handling (#25)
Now that Ace correctly exits with code 1 on error, there is no need to check stderr. This also prevents us from interpreting output from deprecation warnings as manifest generation errors.
1 parent 0014ffe commit 1772b9d

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/Manifest/index.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,6 @@ export class Manifest {
5858
},
5959
})
6060

61-
/**
62-
* Print warning when `stderr` exists
63-
*/
64-
if (response.stderr) {
65-
if (this.isMalformedJSONError(response.stderr) && this.attempts < this.maxAttempts) {
66-
this.attempts++
67-
return this.generate()
68-
}
69-
70-
this.logger.warning(WARN_MESSAGE)
71-
this.logger.logError(response.stderr)
72-
return false
73-
}
74-
7561
/**
7662
* Log success
7763
*/

test/compiler.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ test.group('Compiler', (group) => {
606606
assert.isTrue(hasPackageLock)
607607
}).timeout(0)
608608

609-
test('gracefully log error when ace file writes to stderr', async (assert) => {
609+
test('gracefully log error when ace file finishes with non-zero exit code', async (assert) => {
610610
await fs.add(
611611
'.adonisrc.json',
612612
JSON.stringify({
@@ -624,7 +624,7 @@ test.group('Compiler', (group) => {
624624
})
625625
)
626626

627-
await fs.add('ace', "console.error('foo')")
627+
await fs.add('ace', "console.error('foo');process.exit(1)")
628628
await fs.add('src/foo.ts', '')
629629
await fs.add('public/styles/main.css', '')
630630
await fs.add('public/scripts/main.js', '')

0 commit comments

Comments
 (0)