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.

TypeErrors aren't caught by application

See original GitHub issue

Platform: iOS TNS: 3.1.0

It’s been like this since 2.5 (or maybe even earlier) for me. My {N} applications do not catch any TypeErrors.

Say I make this typing error:

  function test() {
    this.options = { foo: false };
    this.optoins.foo = true;
  }

In the function I mistype this.options as this.optoins. But the terminal doesn’t log the error unless I wrap the code in a try/catch. Developing an application without TypeError logging by default slows down the development process A LOT. How can I fix this?

I know there is an event inside the application module called uncaughtErrorEvent, but this is about a TypeErrorEvent, which doesn’t seem to exist.

Thanks in advance!

<bountysource-plugin>

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
NickIlievcommented, Dec 11, 2019

Type errors are now caught by uncaughtErrorEvent on both iOS and Android

file:///app/home/home-page.js:10:9: JS ERROR TypeError: undefined is not an object (evaluating 'this.options = { foo: false }')
0reactions
CoreyColecommented, Aug 24, 2018

I’m also running into a TypeError and it is not caught by applicationOn(uncaughtErrorEvent). I trigger it by adding a (tap)="functionName" where functionName is not defined. I get error:

ERROR TypeError: _co.functionName is not a function

I was hoping stuff like this would be caught by applicationOn(uncaughtErrorEvent).

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - How to pass catch error inside function into parent
You can just throw it again and again until the app crashes :D ... responses depending on the error type (ReferenceError, TypeError, etc)....
Read more >
TypeError - JavaScript - MDN Web Docs
A TypeError may be thrown when: an operand or argument passed to a function is incompatible with the type expected by that operator...
Read more >
How to Throw Exceptions in Python - Rollbar
And it's your application's job—and your job as a coder—to catch ... Python throws the TypeError exception when there are wrong data types....
Read more >
Built-in Exceptions — Python 3.11.1 documentation
A TypeError is raised if note is not a string. ... The exception inherits from BaseException so as to not be accidentally caught...
Read more >
Types of Exceptions in Java - Stackify
The parent class of all the exception classes is the java.lang.Exception class. ... You can manage them with the help of try-catch blocks....
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