Revert "Cas output exception instead of -1"

This reverts commit 7eab2db8a1f2d54ec4e28729704f0c102055fe52.