Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications to accomodate server-side changes for version compatibi…
…lity check between client and server.
- Loading branch information
1 parent
f4001a6
commit 13ad36d
Showing
11 changed files
with
535 additions
and
24 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,91 @@ | ||
package exception | ||
|
||
import ( | ||
"fmt" | ||
"github.com/TIBCOSoftware/tgdb-client/client/goAPI/types" | ||
) | ||
|
||
/** | ||
* Copyright 2018-19 TIBCO Software Inc. All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); You may not use this file except | ||
* in compliance with the License. | ||
* A copy of the License is included in the distribution package with this file. | ||
* You also may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF DirectionAny KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* File name: TGErrorVersionMismatchException.go | ||
* Created on: Feb 20, 2019 | ||
* Created by: achavan | ||
* SVN id: $id: $ | ||
* | ||
*/ | ||
|
||
type VersionMismatchException struct { | ||
*types.TGDBError | ||
} | ||
|
||
// Create New VersionMismatchException Instance | ||
func DefaultTGVersionMismatchException() *VersionMismatchException { | ||
newException := VersionMismatchException{ | ||
TGDBError: types.DefaultTGDBError(), | ||
} | ||
newException.ErrorType = types.TGErrorVersionMismatchException | ||
return &newException | ||
} | ||
|
||
func NewTGVersionMismatchException(eCode string, eType int, eMsg, eDetails string) *VersionMismatchException { | ||
newException := DefaultTGVersionMismatchException() | ||
newException.ErrorCode = eCode | ||
newException.ErrorType = eType | ||
newException.ErrorMsg = eMsg | ||
newException.ErrorDetails = eDetails | ||
return newException | ||
} | ||
|
||
func NewTGVersionMismatchExceptionAttr(attrTypeName string) *VersionMismatchException { | ||
newException := DefaultTGVersionMismatchException() | ||
newException.ErrorMsg = fmt.Sprintf("Attribute descriptor: '%s' not supported", attrTypeName) | ||
return newException | ||
} | ||
|
||
func NewTGVersionMismatchExceptionWithMsg(msg string) *VersionMismatchException { | ||
newException := DefaultTGVersionMismatchException() | ||
newException.ErrorMsg = msg | ||
return newException | ||
} | ||
|
||
///////////////////////////////////////////////////////////////// | ||
// Implement functions from Interface ==> TGError | ||
///////////////////////////////////////////////////////////////// | ||
|
||
func (e *VersionMismatchException) GetErrorCode() string { | ||
return e.ErrorCode | ||
} | ||
|
||
func (e *VersionMismatchException) GetErrorType() int { | ||
return e.ErrorType | ||
} | ||
|
||
func (e *VersionMismatchException) GetErrorMsg() string { | ||
return e.ErrorMsg | ||
} | ||
|
||
func (e *VersionMismatchException) GetErrorDetails() string { | ||
return e.ErrorDetails | ||
} | ||
|
||
///////////////////////////////////////////////////////////////// | ||
// Implement functions from Interface ==> error | ||
///////////////////////////////////////////////////////////////// | ||
|
||
func (e *VersionMismatchException) Error() string { | ||
errMsg := fmt.Sprintf("ErrorCode: %s, ErrorType: %d, ErrorMessage: %s, ErrorDetails: %s", e.ErrorCode, e.ErrorType, e.ErrorMsg, e.ErrorDetails) | ||
return errMsg | ||
} | ||
|
This file contains 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
Oops, something went wrong.