Throw an error if the direction is negative
Random direction must be in the range [0-7]