mirror of
https://github.com/Permissionless-Software-Foundation/bch-js.git
synced 2026-09-21 16:51:59 -07:00
fix(error): Adding additional rate limit error handling
This commit is contained in:
@@ -121,6 +121,7 @@ class RawTransactions {
|
||||
throw new Error('Input must be a string or array of strings.')
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
@@ -186,6 +187,7 @@ class RawTransactions {
|
||||
throw new Error('Input must be a string or array of strings.')
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
@@ -282,6 +284,7 @@ class RawTransactions {
|
||||
throw new Error('Input must be a string or array of strings.')
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
@@ -327,6 +330,7 @@ class RawTransactions {
|
||||
return retArray
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
@@ -380,6 +384,7 @@ class RawTransactions {
|
||||
return txDetails
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
@@ -453,6 +458,7 @@ class RawTransactions {
|
||||
throw new Error('Input hex must be a string or array of strings.')
|
||||
} catch (error) {
|
||||
if (error.response && error.response.data) throw error.response.data
|
||||
if (error.error) throw new Error(error.error)
|
||||
else throw error
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user