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.

Cannot find a way to catch Error: Another hypercore is stored here error

See original GitHub issue

When creating a new database, if you erroneously try to create a new database over an existing one, you get Error: Another hypercore is stored here. However, I can find no way of catching this error so that I can handle it gracefully when using hyperdb.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
m-onzcommented, Feb 17, 2019

Also, you could store your DB name in local storage or as a cookie.

Bit crude but its a work around.

0reactions
joehandcommented, Feb 17, 2019

I was running into this too and decided to use the discovery key so you can store multiple dats:

var crypto = require('hypercore-crypto')
var db = require('random-access-idb')

var key = 'dat://somedatkey'

var discoveryKey = crypto.discoveryKey(key)
var archive = hyperdrive(db(discoveryKey.toString('hex')), key)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling, "try...catch"
So, try...catch can only handle errors that occur in valid code. ... As we already know, JavaScript supports the JSON.parse(str) method to ...
Read more >
Node.js Error Handling Best Practices: Ship With Confidence
The first thing to know about Node.js error handling is the error object. ... Here we can see that the init function has...
Read more >
7 Handling PL/SQL Errors
To handle other Oracle errors, you can use the OTHERS handler. The functions SQLCODE and SQLERRM are especially useful in the OTHERS handler...
Read more >
How to implement error handling in SQL Server
Handling errors using TRY…CATCH. Here's how the syntax looks like. It's pretty simple to get the hang of. We have two blocks of...
Read more >
[NEW RELEASE] HyperCore Kitchen MULTIDEVICE !!! | Page 4 ...
Exactly! I ran a search on the Pandora dump, all three were in the XIP section. But where do I get the missing...
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