1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00
persephone/Persephone/MPDClient/Extensions/MPDClient+Error.swift
Dan Barber fe748e2c61
WIP: Refactor MPDClient
This should make handling the queuing side work more reliably.
2019-03-20 20:06:23 -04:00

25 lines
474 B
Swift

//
// Error.swift
// Persephone
//
// Created by Daniel Barber on 2019/3/15.
// Copyright © 2019 Dan Barber. All rights reserved.
//
import Foundation
import mpdclient
extension MPDClient {
func getLastErrorMessage() -> String? {
if mpd_connection_get_error(connection) == MPD_ERROR_SUCCESS {
return nil
}
if let errorMessage = mpd_connection_get_error_message(connection) {
return String(cString: errorMessage)
}
return nil
}
}