gl2: move error handling to internal/glc