Replace assert with exception in Ringbuffer