There are some cases where the error that gets returned from scope.Run is not a core.CommandError which results in a type mismatch panic. This fixes that and wraps any generic errors into the proper response struct.