Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silent fail when a NSLog(...) is parsed #502

Open
rjstelling opened this issue Jan 21, 2015 · 1 comment
Open

Silent fail when a NSLog(...) is parsed #502

rjstelling opened this issue Jan 21, 2015 · 1 comment

Comments

@rjstelling
Copy link

I was having an issue where apple doc would bail out of a class and report no errors. I was getting docs generated to a specific point in the file anything above this would work anything below would not be parsed.

I tracked it down to this line of code:

NSLog(@"auth.login response : %@", body);

It seems to be the auth.login that causes issues and other strings cause the same issue like video.preupload for example.

Commenting out the code or adding a space is a workaround.

Here is the command I used to generate the docs:

appledoc --project-name XXXX --project-company "XXXXXX" --company-id com.XXXXXXX --output "~/Desktop/XXXXX Docs" --ignore .h --no-create-docset --verbose 0 .

Here is a full(ish) listing of the code that causes the issue.

/**
 *
 *  Login to the XXXXXX webservice.
 *
 *  The topic `auth.login` is sent with a message dictionary containing the keys `username` and `password`, these correspond to the parameters.
 *
 *  The message received back after calling `auth.login` will have a `status`, if this is "ok" the `body` will contain a dictionary with the following parameters:
 *
 *    - `sessionID`
 *    - `user`
 *
 *  @param username     Either the users email or XXXXX number
 *  @param password     Password or PIN
 *  @param successBlock A block called when the user successfuly login in, this has no parameters
 *  @param failBlock    A block called when the server returns an error, an NSError object is returned to this block
 */
- (void)loginWithUsername:(NSString *)username andPassword:(NSString *)password success:(void (^)())successBlock failure:(void (^)(NSError *error))failBlock
{
    if (username.length == 0) {
        dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{

            _sessionId = @"VALID_SESSION";

            successBlock();
        });
    }
    else {
        [_bus send:@"auth.login" message:@{@"username": username, @"password": password} replyHandler:^(id<GDCMessage> message) {

            NSMutableDictionary *body = [message body];

            //NSLog(@"auth.login response : %@", body); //<--- This causes appledoc to bail
            NSLog(@"%@ response : %@", @"auth.login", body); //<--- this is fine!!!!

            NSString *status = [body objectForKey:@"status"];

            if ([status isEqualToString:@"ok"]) {

                   //code here...

                successBlock();
            }
            else {
                failBlock([[NSError alloc] initWithDomain:kZoomServerErrorDomain code:kZoomErrorAuthLogin userInfo:body]);
            }
        }];
    }
}
@tomaz
Copy link
Owner

tomaz commented Jan 21, 2015

That's strange, appledoc should ignore code inside methods. I tend to document headers though so it may have slipped unnoticed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants