cómo imprimir un error en catch
catch let error as LocksmithError{
print(error)// it would print the case of the error.
}
Sin embargo si lo hago
catch LocksmithError.Duplicate{
}
catch{
print (LocksmithError) // Obviously I would just print LocksmithError, it won't print the case
print (LocksmithError.rawValue) // prints nothing
}
Mi pregunta es: Usando el segundo enfoque, ¿hay algo que realmente pueda recuperar y el valor / caso del error? O si no obtengo el valor correcto en el punto de entrada, es decir, la captura, ¡entonces pierdo la oportunidad de hacerlo!