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

Add New method to TerminalError #82

Merged
merged 1 commit into from
Apr 5, 2022
Merged

Conversation

nmvk
Copy link
Member

@nmvk nmvk commented Apr 5, 2022

This method helps to throw terminal error from the controller.

Controller code can throw errors like

	if *latestStatus == "create-failed" {
		return nil, ackerr.TerminalError.New(errors.New("cluster cannot be updated as its status is not 'available'."))
	}

Code generator changes - aws-controllers-k8s/code-generator#318

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This method helps to throw terminal error from the controller.
@RedbackThomson
Copy link
Contributor

I don't quite understand. Is this any different from &TerminalError{err: fmt.Errorf("my error message")}?

@nmvk
Copy link
Member Author

nmvk commented Apr 5, 2022

I don't quite understand. Is this any different from &TerminalError{err: fmt.Errorf("my error message")}?

This would throw Unexported field 'err' usage since we want to throw the error outside of the package?

@RedbackThomson RedbackThomson changed the title Add new method to TerminalError Add New method to TerminalError Apr 5, 2022
@RedbackThomson
Copy link
Contributor

/lgtm

@ack-bot ack-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 5, 2022
@ack-bot
Copy link
Collaborator

ack-bot commented Apr 5, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nmvk, RedbackThomson

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-bot ack-bot merged commit a1b0863 into aws-controllers-k8s:main Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm Indicates that a PR is ready to be merged.
Projects
None yet
3 participants