Throw an error if it isn't a restricted error

Signed-off-by: Ian Macalinao <me@ian.pw>