Skip to content

Commit

Permalink
improving error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
leogdion committed Apr 9, 2020
1 parent a8d135e commit 76ec8e0
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Speculid.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1856,6 +1856,9 @@
B3E9A9001FB4DCCA00FD8E7A /* autorevision.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = autorevision.json; sourceTree = "<group>"; };
B3E9A9021FB4DDE400FD8E7A /* Version.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Version.swift; sourceTree = "<group>"; };
B3E9A9041FB4E0B200FD8E7A /* bin */ = {isa = PBXFileReference; lastKnownFileType = folder; path = bin; sourceTree = "<group>"; };
B3EC99A2243EA409008D5081 /* badSVG.speculid */ = {isa = PBXFileReference; lastKnownFileType = text; path = badSVG.speculid; sourceTree = "<group>"; };
B3EC99A3243EA409008D5081 /* badJSON.speculid */ = {isa = PBXFileReference; lastKnownFileType = text; path = badJSON.speculid; sourceTree = "<group>"; };
B3EC99A5243EA4D5008D5081 /* missingJSON.speculid */ = {isa = PBXFileReference; lastKnownFileType = text; path = missingJSON.speculid; sourceTree = "<group>"; };
B3F0ECEF1F9E6A4D0078690E /* SpeculidImageSpecificationBuilderProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeculidImageSpecificationBuilderProtocol.swift; sourceTree = "<group>"; };
B3F0ECF11F9E6AAD0078690E /* SpeculidImageSpecificationBuilder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpeculidImageSpecificationBuilder.swift; sourceTree = "<group>"; };
B3F6E278233C3BF100B28DA2 /* AssetSpecificationFileProtocol.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssetSpecificationFileProtocol.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4114,6 +4117,9 @@
isa = PBXGroup;
children = (
B3F8DE14243E77400028BD75 /* badsourcePath.speculid */,
B3EC99A3243EA409008D5081 /* badJSON.speculid */,
B3EC99A5243EA4D5008D5081 /* missingJSON.speculid */,
B3EC99A2243EA409008D5081 /* badSVG.speculid */,
B3F8DE13243E77250028BD75 /* badassetPath.speculid */,
);
path = samples;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@
</CommandLineArgument>
<CommandLineArgument
argument = "--process &quot;${SRCROOT}/samples/badsourcePath.speculid&quot;"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "--process &quot;${SRCROOT}/samples/badJSON.speculid&quot;"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
Expand Down
4 changes: 2 additions & 2 deletions frameworks/cairosvg/ImageHandleBuilder.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ + (ImageHandleBuilder*) shared {
{
case kSvg:
rsvgHandle = rsvg_handle_new_from_file(file.url.path.UTF8String , &gerror);
*error = [[NSError alloc] initWithGError: gerror withURL:file.url];
if (error != nil) {
if (gerror != nil) {
*error = [[NSError alloc] initWithGError: gerror withURL:file.url];
return nil;
} else {
return [[SVGImageHandle alloc] initWithRsvgHandle: rsvgHandle];
Expand Down
4 changes: 4 additions & 0 deletions samples/Image Set.speculid
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"set" : "Assets.xcassets/ImageSet.imageset",
"source" : "geometry.svg"
}
7 changes: 7 additions & 0 deletions samples/badJSON.speculid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"set" : "AppIcon.appiconset",
"source" : "geometry.svg",
"background" : "#EC3ZZZSSX",
"remove-alpha" : flase
}

7 changes: 7 additions & 0 deletions samples/badSVG.speculid
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"set" : "Assets.xcassets/iOS AppIcon.appiconset",
"source" : "geometry-bad.svg",
"background" : "#FFFFFF",
"remove-alpha" : true
}

6 changes: 6 additions & 0 deletions samples/missingJSON.speculid
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"set" : "AppIcon.appiconset",
"background" : "#FFFFFF",
"remove-alpha" : true
}

0 comments on commit 76ec8e0

Please sign in to comment.