Differences From Artifact [e7b34fe947]:
- File
src/exceptions/OFWriteFailedException.m
— part of check-in
[4f36894ce7]
at
2017-06-05 17:36:28
on branch trunk
— Clean up exceptions a little
This removes several initializers that omitted the errNo. Removing those
forces to think about whether there is a meaningful errNo to set instead
of just omitting it. (user: js, size: 894) [annotate] [blame] [check-ins using]
To Artifact [16fd1ae620]:
- File
src/exceptions/OFWriteFailedException.m
— part of check-in
[2ae01218ef]
at
2017-06-12 22:29:41
on branch trunk
— OFWriteFailedException: Add -[bytesWritten]
This allows retrieving the number of bytes already written before the
write failed, allowing to retry without writing data that has already
been written. (user: js, size: 1990) [annotate] [blame] [check-ins using]
︙ | |||
16 17 18 19 20 21 22 23 24 25 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + | #include "config.h" #import "OFWriteFailedException.h" #import "OFString.h" @implementation OFWriteFailedException @synthesize bytesWritten = _bytesWritten; + (instancetype)exceptionWithObject: (id)object requestedLength: (size_t)requestedLength errNo: (int)errNo { return [[[self alloc] initWithObject: object requestedLength: requestedLength errNo: errNo] autorelease]; } + (instancetype)exceptionWithObject: (id)object requestedLength: (size_t)requestedLength bytesWritten: (size_t)bytesWritten errNo: (int)errNo { return [[[self alloc] initWithObject: object requestedLength: requestedLength bytesWritten: bytesWritten errNo: errNo] autorelease]; } - initWithObject: (id)object requestedLength: (size_t)requestedLength errNo: (int)errNo { OF_INVALID_INIT_METHOD } - initWithObject: (id)object requestedLength: (size_t)requestedLength bytesWritten: (size_t)bytesWritten errNo: (int)errNo { self = [super initWithObject: object requestedLength: requestedLength errNo: errNo]; _bytesWritten = bytesWritten; return self; } - (OFString *)description { return [OFString stringWithFormat: @"Failed to write %zu bytes (after %zu bytes written) to an " |