change catch (error) to catch (errorCaught)