Skip to content

Commit

Permalink
Better Exception Description helping with "Defensive Programming"
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Oliveira committed Sep 5, 2011
1 parent 09c7d12 commit e337106
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/extThree20CSSStyle/Sources/TTDefaultCSSStyleSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ - (id)init {
BOOL loadedSuccessfully = [_styleSheet
loadFromFilename:TTPathForBundleResource(kDefaultCSSPath)];

// If this fails, it's very likely that you forgot to add the extThree20CSSStyle.bundle file
// to your project. If you didn't, ensure that it's being copied in the "Copy Bundle Resources"
// phase.
TTDASSERT(loadedSuccessfully);
// Test if load succesfully.
if (!loadedSuccessfully) {
// Bail out.
[NSException raise:NSInternalInconsistencyException
format:@"%@ fail to load the Default CSS file. "
@"It's very likely that you forgot to add the extThree20CSSStyle.bundle "
@"to your project. If you didn't, ensure that it's being copied in "
@"the 'Copy Bundle Resources' phase.", NSStringFromClass([self class])];
return nil;
}
}

Expand Down

0 comments on commit e337106

Please sign in to comment.