Try/catch for setting TYPE_EC