Log frontend errors
POST
/errors
const url = 'http://localhost:3001/errors';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"batchTimestamp":1,"errors":[{"additionalInfo":{},"componentStack":"example","environment":"example","errorType":"example","message":"example","stack":"example","timestamp":1,"url":"example","userAddress":"example","userAgent":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3001/errors \ --header 'Content-Type: application/json' \ --data '{ "batchTimestamp": 1, "errors": [ { "additionalInfo": {}, "componentStack": "example", "environment": "example", "errorType": "example", "message": "example", "stack": "example", "timestamp": 1, "url": "example", "userAddress": "example", "userAgent": "example" } ] }'Accept batch error reports from frontend for logging
Request Bodyrequired
Section titled “Request Bodyrequired”Error batch
Media typeapplication/json
object
batchTimestamp
integer
errors
Array<object>
object
additionalInfo
object
key
additional properties
any
componentStack
string
environment
string
errorType
string
message
string
stack
string
timestamp
integer
url
string
userAddress
string
userAgent
string
Examplegenerated
{ "batchTimestamp": 1, "errors": [ { "additionalInfo": {}, "componentStack": "example", "environment": "example", "errorType": "example", "message": "example", "stack": "example", "timestamp": 1, "url": "example", "userAddress": "example", "userAgent": "example" } ]}Responses
Section titled “Responses”Errors logged successfully
Media typeapplication/json
object
key
additional properties
any
Examplegenerated
{}Invalid request
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Rate limit exceeded
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}Server error
Media typeapplication/json
object
error
string
success
boolean
Examplegenerated
{ "error": "example", "success": true}