fix(error): Adding additional rate limit error handling

This commit is contained in:
Chris Troutner
2021-06-19 10:08:28 -07:00
parent 5759b096d5
commit e8e615795d
+6
View File
@@ -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
}
}