Skip to content

Commit

Permalink
Better error message for invalid type annotation
Browse files Browse the repository at this point in the history
Summary: Just a minor error message improvement

Reviewed By: TheSavior, osdnk

Differential Revision: D16759233

fbshipit-source-id: c53c54535eca683353085a8d2272c60596b52b54
  • Loading branch information
rickhanlonii authored and facebook-github-bot committed Aug 12, 2019
1 parent e110f04 commit a60e581
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,11 @@ function getNativeTypeFromAnnotation(componentName: string, prop): string {
return getEnumName(componentName, prop.name);
default:
(typeAnnotation: empty);
throw new Error('Received invalid typeAnnotation');
throw new Error(
`Received invalid typeAnnotation for ${componentName} prop ${
prop.name
}, received ${typeAnnotation.type}`,
);
}
}

Expand Down

0 comments on commit a60e581

Please sign in to comment.