mirror of
https://github.com/qvacua/vimr.git
synced 2024-11-24 03:25:03 +03:00
GH-297 Use a bit more detailed error log
This commit is contained in:
parent
af718bc3e5
commit
0fea3a6acd
@ -26,6 +26,31 @@ data_to_array(int)
|
||||
data_to_array(bool)
|
||||
data_to_array(CellAttributes)
|
||||
|
||||
static void log_cfmachport_error(SInt32 err, NeoVimAgentMsgId msgid, NSData *inputData) {
|
||||
switch (err) {
|
||||
case kCFMessagePortSendTimeout:
|
||||
log4Warn("Got response kCFMessagePortSendTimeout = %d for the msg %lu with data %@.",
|
||||
err, (unsigned long) msgid, inputData);
|
||||
case kCFMessagePortReceiveTimeout:
|
||||
log4Warn("Got response kCFMessagePortReceiveTimeout = %d for the msg %lu with data %@.",
|
||||
err, (unsigned long) msgid, inputData);
|
||||
case kCFMessagePortIsInvalid:
|
||||
log4Warn("Got response kCFMessagePortIsInvalid = %d for the msg %lu with data %@.",
|
||||
err, (unsigned long) msgid, inputData);
|
||||
case kCFMessagePortTransportError:
|
||||
log4Warn("Got response kCFMessagePortTransportError = %d for the msg %lu with data %@.",
|
||||
err, (unsigned long) msgid, inputData);
|
||||
case kCFMessagePortBecameInvalidError:
|
||||
log4Warn("Got response kCFMessagePortBecameInvalidError = %d for the msg %lu with data %@.",
|
||||
err, (unsigned long) msgid, inputData);
|
||||
return;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@interface NeoVimAgent ()
|
||||
|
||||
- (void)handleMessageWithId:(SInt32)msgid data:(NSData *)data;
|
||||
@ -361,7 +386,7 @@ static CFDataRef local_server_callback(CFMessagePortRef local, SInt32 msgid, CFD
|
||||
);
|
||||
|
||||
if (responseCode != kCFMessagePortSuccess) {
|
||||
log4Warn("Got response %d for the msg %lu with data %@.", responseCode, (unsigned long) msgid, data);
|
||||
log_cfmachport_error(responseCode, msgid, data);
|
||||
return nil;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user