mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fine tune error posting
This commit is contained in:
parent
b858cc4b1b
commit
d07c664b2c
@ -130,7 +130,7 @@ class PreferencesController {
|
|||||||
|
|
||||||
// Notify our servers:
|
// Notify our servers:
|
||||||
const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts'
|
const uri = 'https://diagnostics.metamask.io/v1/orphanedAccounts'
|
||||||
notifier.notify(uri, { accounts: Object.keys(lostIdentities) })
|
notifier.notify(uri, { accounts: Object.keys(newlyLost) })
|
||||||
.catch(log.error)
|
.catch(log.error)
|
||||||
|
|
||||||
for (let key in newlyLost) {
|
for (let key in newlyLost) {
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
class BugNotifier {
|
class BugNotifier {
|
||||||
notify (uri, message) {
|
notify (uri, message) {
|
||||||
return postData(uri, message)
|
return postData(uri, message)
|
||||||
.then(data => console.log(data)) // JSON from `response.json()` call
|
|
||||||
.catch(error => console.error(error))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function postData(uri, data) {
|
function postData(uri, data) {
|
||||||
|
return fetch(uri, {
|
||||||
return fetch(url, {
|
|
||||||
body: JSON.stringify(data), // must match 'Content-Type' header
|
body: JSON.stringify(data), // must match 'Content-Type' header
|
||||||
credentials: 'same-origin', // include, same-origin, *omit
|
credentials: 'same-origin', // include, same-origin, *omit
|
||||||
headers: {
|
headers: {
|
||||||
@ -17,7 +14,6 @@ function postData(uri, data) {
|
|||||||
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
method: 'POST', // *GET, POST, PUT, DELETE, etc.
|
||||||
mode: 'cors', // no-cors, cors, *same-origin
|
mode: 'cors', // no-cors, cors, *same-origin
|
||||||
})
|
})
|
||||||
.then(response => response.json()) // parses response to JSON
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = BugNotifier
|
module.exports = BugNotifier
|
||||||
|
Loading…
x
Reference in New Issue
Block a user