[AltKit] Includes underlying error in error response

This commit is contained in:
Riley Testut
2020-06-05 14:19:40 -07:00
parent fafec6c904
commit 186ad09ab3
3 changed files with 79 additions and 11 deletions

View File

@@ -25,12 +25,12 @@ public extension ALTServerError
userInfo[NSUnderlyingErrorKey] = error
}
self = ALTServerError(.unknown, userInfo: error.userInfo)
self = ALTServerError(.underlyingError, userInfo: userInfo)
}
}
init<E: Error>(_ code: ALTServerError.Code, underlyingError: E)
{
self = ALTServerError(.invalidRequest, userInfo: [NSUnderlyingErrorKey: underlyingError])
self = ALTServerError(code, userInfo: [NSUnderlyingErrorKey: underlyingError])
}
}