Fix #284 by catching the exception in code().