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

Lab 7 - Errors #589

Open
patrickmarabeas opened this issue Aug 19, 2019 · 0 comments
Open

Lab 7 - Errors #589

patrickmarabeas opened this issue Aug 19, 2019 · 0 comments
Assignees

Comments

@patrickmarabeas
Copy link
Collaborator

Lab 7 - Errors

  • Create an executable go program in directory 07_errors/USERNAME
  • Copy the CRUD puppy from upstream master 06_puppy/USERNAME
  • Add a custom error type Error with fields Message and Code
  • Extend the Storer interface for all methods to also return error
  • Create errors for:
    - Value < 0
    - ID not found in Read, Update and Delete
  • Add locking for proper use of sync.Map
  • Bonus points: Add a third Storer implementation using leveldb
@patrickmarabeas patrickmarabeas self-assigned this Aug 19, 2019
patrickmarabeas added a commit to patrickmarabeas/go-course that referenced this issue Aug 19, 2019
patrickmarabeas added a commit to patrickmarabeas/go-course that referenced this issue Aug 19, 2019
Adds a NewError function which creates a new error of the custom error
type `Error` (contraining fields: `Message` and `Code`) with the given
enum.

Error enums for the package begin at 1001.

Errors being handled:
- Puppy value < 0
- Puppy ID not found

Lab 07 (anz-bank#589)
patrickmarabeas added a commit to patrickmarabeas/go-course that referenced this issue Aug 19, 2019
In order to implement the Storer interface, all methods must now return
and error.

The value property in Puppy has had its type changed to an int to
represent a numerical cent figure so that it may be properly throw an
error if the value supplied is less than 0.

Lab 07 (anz-bank#589)
patrickmarabeas added a commit to patrickmarabeas/go-course that referenced this issue Aug 19, 2019
- Value < 0 in Create and Update
- ID not found in Read, Update and Delete

Lab 07 (anz-bank#589)
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 a pull request may close this issue.

1 participant