a simple error code slicer