File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -259,13 +259,23 @@ - (void)generateWithDestinationPath:(NSString *)destPath parserName:(NSString *)
259259 NSString *path = [[NSString stringWithFormat: @" %@ /%@ .h" , destPath, className] stringByExpandingTildeInPath ];
260260 err = nil ;
261261 if (![_visitor.interfaceOutputString writeToFile: path atomically: YES encoding: NSUTF8StringEncoding error: &err]) {
262- NSLog (@" %@ " , err);
262+ NSMutableString *str = [NSMutableString stringWithString: [err localizedFailureReason ]];
263+ [str appendFormat: @" \n\n %@ " , [path stringByDeletingLastPathComponent ]];
264+ id dict = [NSMutableDictionary dictionaryWithDictionary: [err userInfo ]];
265+ dict[NSLocalizedFailureReasonErrorKey ] = str;
266+ self.error = [NSError errorWithDomain: [err domain ] code: [err code ] userInfo: dict];
267+ goto done;
263268 }
264269
265270 path = [[NSString stringWithFormat: @" %@ /%@ .m" , destPath, className] stringByExpandingTildeInPath ];
266271 err = nil ;
267272 if (![_visitor.implementationOutputString writeToFile: path atomically: YES encoding: NSUTF8StringEncoding error: &err]) {
268- NSLog (@" %@ " , err);
273+ NSMutableString *str = [NSMutableString stringWithString: [err localizedFailureReason ]];
274+ [str appendFormat: @" \n\n %@ " , [path stringByDeletingLastPathComponent ]];
275+ id dict = [NSMutableDictionary dictionaryWithDictionary: [err userInfo ]];
276+ dict[NSLocalizedFailureReasonErrorKey ] = str;
277+ self.error = [NSError errorWithDomain: [err domain ] code: [err code ] userInfo: dict];
278+ goto done;
269279 }
270280
271281done:
You can’t perform that action at this time.
0 commit comments