Update panelController.js

Returning properly if an error needs to be sent.