-
Notifications
You must be signed in to change notification settings - Fork 235
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Lambda-Runtime-Function-Error-Type for reporting errors in format…
… "Runtime.<Error>" (#501) * Introduce Runtime. error codes * fix: apply linting * Remove unused imports --------- Co-authored-by: Alexander Smirnov <[email protected]>
- Loading branch information
Showing
8 changed files
with
86 additions
and
53 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
27 changes: 27 additions & 0 deletions
27
...rc/main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/LambdaError.java
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,27 @@ | ||
/* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package com.amazonaws.services.lambda.runtime.api.client.runtimeapi; | ||
|
||
import com.amazonaws.services.lambda.runtime.api.client.runtimeapi.dto.ErrorRequest; | ||
import com.amazonaws.services.lambda.runtime.api.client.runtimeapi.dto.XRayErrorCause; | ||
|
||
public class LambdaError { | ||
|
||
public final ErrorRequest errorRequest; | ||
|
||
public final XRayErrorCause xRayErrorCause; | ||
|
||
public final RapidErrorType errorType; | ||
|
||
public LambdaError(ErrorRequest errorRequest, XRayErrorCause xRayErrorCause, RapidErrorType errorType) { | ||
this.errorRequest = errorRequest; | ||
this.xRayErrorCause = xRayErrorCause; | ||
this.errorType = errorType; | ||
} | ||
|
||
public LambdaError(ErrorRequest errorRequest, RapidErrorType errorType) { | ||
this(errorRequest, null, errorType); | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
...main/java/com/amazonaws/services/lambda/runtime/api/client/runtimeapi/RapidErrorType.java
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,16 @@ | ||
/* | ||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
package com.amazonaws.services.lambda.runtime.api.client.runtimeapi; | ||
|
||
public enum RapidErrorType { | ||
BadFunctionCode, | ||
UserException, | ||
BeforeCheckpointError, | ||
AfterRestoreError; | ||
|
||
public String getRapidError() { | ||
return "Runtime." + this; | ||
} | ||
} |
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