//
//  Errors.m
//  Flash2
//
//  Created by Nicholas Matsakis on 3/1/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "Errors.h"

bool error(NSError **error, int code, NSString *key) {
    if (error) {
        NSDictionary *userInfo;
        userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
                    NSLocalizedDescriptionKey,
                    NSLocalizedString(key, nil),
                    nil];
        *error = [NSError errorWithDomain:FLASH2_ERROR_DOMAIN 
                                     code:code
                                 userInfo:userInfo];                  
    }
    return NO;
}