question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throwing error() does not display error message.

See original GitHub issue

Given this file:

func()
    if length(arguments) > 1
        error('foo bar')
    font-size arguments
h1
    position absolute
    func 5px 9px

The error is thrown, but the message “foo bar” is not displayed in the console. The command I’m running to compile this file is $ stylus < test.styl > test.css

The console only displays:

/usr/local/lib/node_modules/stylus/bin/stylus:593
      if (err) throw err;

Side note: When using $ stylus --watch, the error message is displayed.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
iivmokcommented, May 26, 2017

I am using stylus from the dev branch. I get the same kind of throw err; message as before. Fixing line 661 from throw err; to throw new Error(err) per @Panya’s suggestion makes stylus show proper errors. Are you guys sure this is fixed?

1reaction
ybordagcommented, Jul 4, 2017

Yea, I basically have the same problem as @iivmok with line 661 and 592. It’s fixed when I added @Panya 's code (throw new Error(err); instead of throw err;).

Read more comments on GitHub >

github_iconTop Results From Across the Web

throw does not show error msg c++ [closed] - Stack Overflow
I'm working on an assignment and for some reason the throw invalid_argument will not display the message "Account balance is too low". I...
Read more >
Throw error and display message - MATLAB error - MathWorks
This MATLAB function throws an error and displays an error message.
Read more >
Error Messages not displaying - UiPath Community Forum
Hello! Help me please. Error messages no longer appear in “DEBUG” mode after updating the UiPath. How to configure error messages display?
Read more >
Write-Error (Microsoft.PowerShell.Utility) - Microsoft Learn
The Write-Error cmdlet declares a non-terminating error. By default, errors are sent in the error stream to the host program to be displayed, ......
Read more >
A Definitive Guide to Handling Errors in JavaScript - Kinsta
Getting tripped up by errors in your JavaScript? We'll show you how to tame those errors so you can get back to developing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found