Skip to content

Commit e0683e9

Browse files
Merge pull request #2 from solid/fix-error-handling
Fix error handling during client registration
2 parents fd2acf5 + b6bb8ec commit e0683e9

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/multi-rp-client.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class MultiRpClient {
8080
})
8181
.catch(error => {
8282
debug('Error in authUrlForIssuer(): ', error)
83+
throw error
8384
})
8485
}
8586

@@ -96,19 +97,23 @@ class MultiRpClient {
9697
debug(`Client fetched for issuer ${issuerUri}`)
9798
return client
9899
}
100+
99101
debug(`Client not present for issuer ${issuerUri}, initializing new client`)
102+
100103
// client not already in store, create and register it
101104
let registrationConfig = this.registrationConfigFor(issuerUri)
102105
return this.registerClient(registrationConfig)
103106
.catch(error => {
104107
debug('Error registering a new client: ', error)
108+
throw error
105109
})
106110
.then(registeredClient => {
107111
// Store and return the newly registered client
108112
return this.persistClient(registeredClient)
109-
})
110-
.catch(error => {
111-
debug('Error persisting registered client: ', error)
113+
.catch(error => {
114+
debug('Error persisting registered client: ', error)
115+
throw error
116+
})
112117
})
113118
})
114119
}

0 commit comments

Comments
 (0)