diff --git a/internal/services/users/user_resource.go b/internal/services/users/user_resource.go index 01a668675..ee936fdf1 100644 --- a/internal/services/users/user_resource.go +++ b/internal/services/users/user_resource.go @@ -483,7 +483,10 @@ func userResourceCreate(ctx context.Context, d *pluginsdk.ResourceData, meta int } if v, ok := d.GetOk("employee_hire_date"); ok { - employeeHireDate, _ := time.Parse(time.RFC3339, v.(string)) + employeeHireDate, err := time.Parse(time.RFC3339, v.(string)) + if err != nil { + tf.ErrorDiagF(err, "Unable to parse the provided employee_hire_date %q: %+v", v, err) + } properties.EmployeeHireDate = &employeeHireDate } @@ -624,7 +627,10 @@ func userResourceUpdate(ctx context.Context, d *pluginsdk.ResourceData, meta int } if d.HasChange("employee_hire_date") { - employeeHireDate, _ := time.Parse(time.RFC3339, d.Get("employee_hire_date").(string)) + employeeHireDate, err := time.Parse(time.RFC3339, d.Get("employee_hire_date").(string)) + if err != nil { + tf.ErrorDiagF(err, "Unable to parse the provided employee_hire_date %q: %+v", d.Get("employee_hire_date"), err) + } properties.EmployeeHireDate = &employeeHireDate }