Permalink
Browse files

Added missing document template validation (forgot about it before).

  • Loading branch information...
1 parent 2095a76 commit 1e1ad04878240871f75c534c02951856cb385982 @tomaz committed Feb 20, 2011
Showing with 8 additions and 0 deletions.
  1. +1 −0 Common/NSError+GBError.h
  2. +7 −0 Generating/GBHTMLOutputGenerator.m
View
@@ -28,6 +28,7 @@ enum {
GBErrorTemplatePathNotDirectory,
GBErrorHTMLObjectTemplateMissing = 8000,
+ GBErrorHTMLDocumentTemplateMissing,
GBErrorHTMLIndexTemplateMissing,
GBErrorHTMLHierarchyTemplateMissing,
@@ -171,6 +171,13 @@ - (BOOL)validateTemplates:(NSError **)error {
}
return NO;
}
+ if (!self.htmlDocumentTemplate) {
+ if (error) {
+ NSString *desc = [NSString stringWithFormat:@"Document template file 'document-template.html' is missing at '%@'!", self.templateUserPath];
+ *error = [NSError errorWithCode:GBErrorHTMLDocumentTemplateMissing description:desc reason:nil];
+ }
+ return NO;
+ }
if (!self.htmlIndexTemplate) {
if (error) {
NSString *desc = [NSString stringWithFormat:@"Index template file 'index-template.html' is missing at '%@'!", self.templateUserPath];

0 comments on commit 1e1ad04

Please sign in to comment.