Add specific messages for network-specific node error codes

This commit is contained in:
Rob Herley committed 2023-12-11 17:07:48 -05:00
1 parent 1f694c311f
commit a7f5604d2c
4 files changed
+86 -26

No files matched your search

@@ -4,6 +4,7 @@ import {info, debug} from '@actions/core'
import {ArtifactServiceClientJSON} from '../../generated'
import {getResultsServiceUrl, getRuntimeToken} from './config'
import {getUserAgentString} from './user-agent'
import {NetworkError} from './errors'
// The twirp http client must implement this interface
interface Rpc {
@@ -96,6 +97,9 @@ class ArtifactHttpClient implements Rpc {
} catch (error) {
isRetryable = true
errorMessage = error.message
if (NetworkError.isNetworkErrorCode(error?.code)) {
throw new NetworkError(error?.code)
}
}
if (!isRetryable) {