-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Rdo 2 all errors to file sd ks #157
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
Open
John-Memphis
wants to merge
8
commits into
master
Choose a base branch
from
RDO-2-all-errors-to-file-sd-ks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
18c0bb0
"moved errors from connect and consumer to file"
John-Memphis d6c907d
"All errors are in memphis_errors.go"
John-Memphis 8d961c7
Merge branch 'master' into RDO-2-all-errors-to-file-sd-ks
John-Memphis 707c084
Merge branch 'master' into RDO-2-all-errors-to-file-sd-ks
John-Memphis f38075e
"Changed errors var to const"
John-Memphis b12dd50
Merge branch 'RDO-2-all-errors-to-file-sd-ks' of github.com-memphis:m…
John-Memphis edc4620
"Const can't actually work here"
John-Memphis 4ede2fc
"Changed errors.new to fmt.errorF when wanting to add a string to an …
John-Memphis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| package memphis | ||
|
|
||
| import ( | ||
| "fmt" | ||
| "strconv" | ||
| "errors" | ||
| ) | ||
|
|
||
| var ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use const here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shay23b Value of type error cannot be const is what the compiler complains about so I guess not |
||
| errInvalidConnectionType = memphisError(errors.New("you have to connect with one of the following methods: connection token / password")) | ||
| errMissingTLSCertFile = memphisError(errors.New("must provide a TLS cert file")) | ||
| errMissingTLSKeyFile = memphisError(errors.New("must provide a TLS key file")) | ||
| errMissingTLSCaFile = memphisError(errors.New("must provide a TLS ca file")) | ||
| errPartitionNumOutOfRange = memphisError(errors.New("partition number is out of range")) | ||
| errConsumerErrStationUnreachable = memphisError(errors.New("station unreachable")) | ||
| errConsumerErrConsumeInactive = memphisError(errors.New("consumer is inactive")) | ||
| errConsumerErrDelayDlsMsg = memphisError(errors.New("cannot delay DLS message")) | ||
| errInvalidMessageFormat = memphisError(errors.New("message format is not supported")) | ||
| errExpectingProtobuf = memphisError(errors.New("invalid message format, expecting protobuf")) | ||
| errBothPartitionNumAndKey = memphisError(errors.New("can not use both partition number and partition key")) | ||
| errStartConsumeNotPositive = memphisError(errors.New("startConsumeFromSequence has to be a positive number")) | ||
| errLastMessagesNegative = memphisError(errors.New("min value for LastMessages is -1")) | ||
| errBothStartConsumeAndLastMessages = memphisError(errors.New("Consumer creation options can't contain both startConsumeFromSequence and lastMessages")) | ||
| errUnreachableStation = memphisError(errors.New("station unreachable")) | ||
| errInvalidStationName = memphisError(errors.New("station name should be either string or []string")) | ||
| errInvalidHeaderKey = memphisError(errors.New("keys in headers should not start with $memphis")) | ||
| errUnsupportedMsgType = memphisError(errors.New("unsupported message type")) | ||
| errEmptyMsgId = memphisError(errors.New("msg id can not be empty")) | ||
| errPartitionNotInKey = memphisError(errors.New("failed to get partition from key")) | ||
| errMissingFunctionsListener = memphisError(errors.New("functions listener doesn't exist")) | ||
| errMissingSchemaListener = memphisError(errors.New("schema listener doesn't exist")) | ||
| errStationNotSubedToSchema = memphisError(errors.New("station subscription doesn't exist")) | ||
| errInvalidSchmeaType = memphisError(errors.New("invalid schema type")) | ||
| errExpectinGraphQL = memphisError(errors.New("invalid message format, expecting GraphQL")) | ||
| ) | ||
|
|
||
| func errInvalidAvroFormat(err error) error{ | ||
| return memphisError(fmt.Errorf("Bad Avro format - %s", err.Error())) | ||
| } | ||
|
|
||
| func errProducerNotInCache(producerName string) error{ | ||
| return memphisError(fmt.Errorf("%s not exists on the map", producerName)) | ||
| } | ||
|
|
||
| func errLoadClientCertFailed(err error) error{ | ||
| return memphisError(fmt.Errorf("memphis: error loading client certificate: %s", err.Error())) | ||
| } | ||
|
|
||
| func errInvalidBatchSize(maxBatchSize int) error{ | ||
| return memphisError(fmt.Errorf("Batch size can not be greater than %s or less than 1", strconv.Itoa(maxBatchSize))) | ||
| } | ||
|
|
||
| func errPartitionNotInStation(partitionNumber int, stationName string) error { | ||
| return memphisError(fmt.Errorf("partition %v does not exist in station %v", partitionNumber, stationName)) | ||
| } | ||
|
|
||
| func errSchemaValidationFailed(err error) error { | ||
| return memphisError(fmt.Errorf("Schema validation has failed: %s", err.Error())) | ||
| } | ||
|
|
||
| func errMessageMisalignedSchema(err error) error { | ||
| return memphisError(fmt.Errorf("Deserialization has been failed since the message format does not align with the currently attached schema: %s", err.Error())) | ||
| } | ||
|
|
||
| func errBadJSON(err error) error { | ||
| return memphisError(fmt.Errorf("Bad JSON format - %s", err.Error())) | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove line