Skip to content

Commit

Permalink
Remove unreachable code
Browse files Browse the repository at this point in the history
  • Loading branch information
jorangreef committed Sep 27, 2019
1 parent 99b4ed1 commit 3a6a64f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,18 @@ MIME.decodeBase64 = function(buffer, body) {

// Non-Spec: We reject illegal and truncated Base64.
switch (error.message) {
case 'source is corrupt':
if (body) {
throw new Error(self.Error.Base64BodyIllegal);
} else {
throw new Error(self.Error.Base64WordIllegal);
}
break;
case 'source is truncated':
if (body) {
throw new Error(self.Error.Base64BodyTruncated);
} else {
throw new Error(self.Error.Base64WordTruncated);
}
break;
case 'source is corrupt':
if (body) {
throw new Error(self.Error.Base64BodyIllegal);
} else {
throw new Error(self.Error.Base64WordIllegal);
}
case 'source is truncated':
if (body) {
throw new Error(self.Error.Base64BodyTruncated);
} else {
throw new Error(self.Error.Base64WordTruncated);
}
}
throw error;
}
Expand Down

0 comments on commit 3a6a64f

Please sign in to comment.