You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As I was writing my implementation of the protocol SessionManager, I realized I needed the createSession to be able to throw errors. After I create my session, I need to persist it to the our database, and that introduces a source of possible thrown errors that can not be propagated back to the network stack as createSession can not throw.
Would it be possible to change the method signature of the createSession method from
func createSession(account:Account)->String
to
func createSession(account:Account)throws->String
?
This would allow me to return an error in the HTTP request that initiated the session creation if the save operation failed.
The text was updated successfully, but these errors were encountered:
As I was writing my implementation of the protocol
SessionManager
, I realized I needed thecreateSession
to be able to throw errors. After I create my session, I need to persist it to the our database, and that introduces a source of possible thrown errors that can not be propagated back to the network stack ascreateSession
can not throw.Would it be possible to change the method signature of the
createSession
method fromto
?
This would allow me to return an error in the HTTP request that initiated the session creation if the save operation failed.
The text was updated successfully, but these errors were encountered: