Removing Duplicate Case Condition in Custom Errors