Refactored error messaging in dock for DRY
Added memory error handler with an informative message