Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose SMB share and NFS export error message #41

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

P-Cao
Copy link
Contributor

@P-Cao P-Cao commented Sep 11, 2023

Description

Export error detail for OpenAPI error
Now output the error message detail

GitHub Issues

List the GitHub issues impacted by this PR:

GitHub Issue #

ISSUE TYPE

  • Bugfix Pull Request
RESOURCE OR DATASOURCE NAME

SMB share
NFS export

OUTPUT

image

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 80% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Unit tests
  • Acceptance tests

@P-Cao P-Cao force-pushed the feature-expose-nfs-smb-error-msg branch 2 times, most recently from 2eb79b9 to 8c41363 Compare September 11, 2023 06:49
@P-Cao
Copy link
Contributor Author

P-Cao commented Sep 11, 2023

run e2e test

resp.Diagnostics.AddError("Error transform nfs export datasource plan",
message)
resp.Diagnostics.AddError("Error reading smb share datasource plan",
fmt.Sprintf("Could not list smb shares with error: %s", err.Error()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could not list nfs export with error

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

)
errStr := constants.GetNfsExportErrorMsg + "with error: "
message := helper.GetErrorString(err, errStr)
response.Diagnostics.AddError("Error creating nfs export ",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reading

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

fmt.Sprintf("Could not recognize nfs export ID: %s with error: %s ",
request.ID, err.Error()),
)
errStr := constants.GetSmbShareErrorMsg + "with error: "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetNfsExportErrorMsg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

fmt.Sprintf("Could not remove nfs export ID: %d with error: %s ",
exportID, err.Error()),
)
errStr := constants.DeleteSmbShareErrorMsg + "with error: "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DeleteNfsExportErrorMsg

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Rechecked all modified files

Export error detail for OpenAPI error
@P-Cao P-Cao force-pushed the feature-expose-nfs-smb-error-msg branch from 8c41363 to ee0fe62 Compare September 12, 2023 02:28
@P-Cao
Copy link
Contributor Author

P-Cao commented Sep 12, 2023

run e2e test

@P-Cao
Copy link
Contributor Author

P-Cao commented Sep 12, 2023

run e2e test

@P-Cao P-Cao merged commit 2977a45 into main Sep 12, 2023
6 checks passed
@P-Cao P-Cao deleted the feature-expose-nfs-smb-error-msg branch September 12, 2023 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants