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

Show full stack trace when build or test command fails #579

Closed
chrispcampbell opened this issue Dec 7, 2024 · 0 comments · Fixed by #581 or #577
Closed

Show full stack trace when build or test command fails #579

chrispcampbell opened this issue Dec 7, 2024 · 0 comments · Fixed by #581 or #577

Comments

@chrispcampbell
Copy link
Contributor

When using the sde build or sde test command, if an error occurs, it currently prints the error message only (without stack trace), for example:

$ ./tests/modeltests longeqns
Testing the longeqns model 
ERROR: Cannot read properties of undefined (reading 'size')

This is because the error handler in sde-build.js for example looks like this:

  } catch (e) {
    // Exit with a non-zero error code if any step failed
    console.error(`ERROR: ${e.message}\n`)
    process.exit(1)
  }

A while back I had changed other sde commands to log the full error message including stack trace, but looks like I missed a couple. We should change these two remaining cases to use the same code as the others:

  } catch (e) {
    // Exit with a non-zero error code if any step failed
    console.error(e)
    console.error()
    process.exit(1)
  }

This will result in the full stack trace appearing:

$ ./tests/modeltests longeqns
Testing the longeqns model 
TypeError: Cannot read properties of undefined (reading 'size')
    at generateArrayFunctionCall (file://sdeverywhere/packages/compile/src/generate/gen-expr.js:650:31)
    at generateFunctionCall (file://sdeverywhere/packages/compile/src/generate/gen-expr.js:282:14)
    at generateExpr (file://sdeverywhere/packages/compile/src/generate/gen-expr.js:150:14)
    ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant