 
 private func parseCounterValue(_ rawValue: String) throws -> UInt64 {
     guard let counterValue = UInt64(rawValue, radix: 10) else {
-        throw DeserializationError.counterValue
+        throw DeserializationError.invalidCounterValue(rawValue)
     }
     return counterValue
 }
 
 private func parseTimerPeriod(_ rawValue: String) throws -> TimeInterval {
     guard let int = Int(rawValue) else {
-        throw DeserializationError.timerPeriod
+        throw DeserializationError.invalidTimerPeriod(rawValue)
     }
     return TimeInterval(int)
 }
 
 private func parseSecret(_ rawValue: String) throws -> Data {
     guard let data = MF_Base32Codec.data(fromBase32String: rawValue) else {
-        throw DeserializationError.secret
+        throw DeserializationError.invalidSecret(rawValue)
     }
     return data
 }
 
 private func parseDigits(_ rawValue: String) throws -> Int {
     guard let intValue = Int(rawValue) else {
-        throw DeserializationError.digits
+        throw DeserializationError.invalidDigits(rawValue)
     }
     return intValue
 }

        } else if string == kFactorTimerKey {
            let period = try queryDictionary[kQueryPeriodKey].map(parseTimerPeriod) ?? defaultPeriod
            return .timer(period: period)
        }
        throw DeserializationError.factor
    }

    let algorithm = try queryDictionary[kQueryAlgorithmKey].map(algorithmFromString) ?? defaultAlgorithm

    case kAlgorithmSHA512:
        return .sha512
    default:
        throw DeserializationError.invalidAlgorithm(string)
    }
}

