mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-06-02 04:06:37 +00:00
Throw error returned from DAGNode.create
This commit is contained in:
parent
74c0e8a799
commit
cab38cbb9c
@ -12,7 +12,12 @@ const createDBManifest = async (ipfs, name, type, accessControllerAddress, onlyH
|
||||
const manifestJSON = JSON.stringify(manifest)
|
||||
if (onlyHash) {
|
||||
dag = await new Promise(resolve => {
|
||||
DAGNode.create(Buffer.from(manifestJSON), (err, n) => { resolve(n) })
|
||||
DAGNode.create(Buffer.from(manifestJSON), (err, n) => {
|
||||
if (err) {
|
||||
throw err
|
||||
}
|
||||
resolve(n)
|
||||
})
|
||||
})
|
||||
} else {
|
||||
dag = await ipfs.object.put(Buffer.from(manifestJSON))
|
||||
|
Loading…
x
Reference in New Issue
Block a user