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.

Importing error classes not working according to doc

See original GitHub issue

I can’t require the proper error classes from The influx lib. It only works for ResultError, it fails for RequestError and ServiceNotAvailableError.

Snippet illustrating my issue:

const Influx = require('influx');

const ResultError = Influx.ResultError;
const RequestError = Influx.RequestError;
const ServiceNotAvailableError = Influx.ServiceNotAvailableError;

Influx version: 5.0.7 Node version: v8.9.1 OS: Windows 7

Did anyone else have similar problems ? If this is indeed a bug, i would be happy to help with a PR. Thank you.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Radu94commented, Jul 24, 2019

@bencevans Thanks for taking the time to look into this 😃

1reaction
bencevanscommented, Jul 24, 2019

The Errors need to be propagated up to the main domain for requirment such as your example @Radu94.

In the meantime they are exported from the pool module and can be imported with:

require('influx/lib/src/pool').RequestError
require('influx/lib/src/pool').ServiceNotAvailableError
Read more comments on GitHub >

github_iconTop Results From Across the Web

Javadoc Exclude causing errors on import - Stack Overflow
Is there a way to "include" the classes/packages, but NOT export the javadoc for them? Edit: Here's the relevant javadoc task: task gendocs(type ......
Read more >
How to Fix ImportError: Cannot Import Name in Python - Rollbar
This error generally occurs when a class cannot be imported due to one of the following reasons: The imported class is in a...
Read more >
Python import: Advanced Techniques and Tips
The Python import system is as powerful as it is useful. In this in-depth tutorial, you'll learn how to harness this power to...
Read more >
Exception Class (System) - Microsoft Learn
When an exception occurs, the runtime makes a text message available to inform the user of the nature of the error and to...
Read more >
Troubleshooting manual import errors - Lexia Help Center
Option 1: Remove the class name from your import file. After the import, manually add the student(s) or staff to the class in...
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