return -1 with the error, and assert