-
Notifications
You must be signed in to change notification settings - Fork 611
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32220 from vespa-engine/hmusum/move-filedistribut…
…ion-error-codes Hmusum/move filedistribution error codes
- Loading branch information
Showing
10 changed files
with
54 additions
and
72 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
16 changes: 0 additions & 16 deletions
16
config/src/main/java/com/yahoo/vespa/config/FileReferenceDoesNotExistException.java
This file was deleted.
Oops, something went wrong.
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
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
39 changes: 39 additions & 0 deletions
39
filedistribution/src/main/java/com/yahoo/vespa/filedistribution/FileApiErrorCodes.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,39 @@ | ||
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. | ||
package com.yahoo.vespa.filedistribution; | ||
|
||
/** | ||
* Error codes used in RPC responses for file distribution | ||
* | ||
* @author hmusum | ||
*/ | ||
public enum FileApiErrorCodes { | ||
|
||
OK(0, "OK"), | ||
NOT_FOUND(1, "File reference not found"), | ||
TIMEOUT(2, "Timeout"), | ||
TRANSFER_FAILED(3, "Failed transferring file"); | ||
private final int code; | ||
private final String description; | ||
|
||
FileApiErrorCodes(int code, String description) { | ||
this.code = code; | ||
this.description = description; | ||
} | ||
|
||
static FileApiErrorCodes get(int code) { | ||
for (FileApiErrorCodes error : FileApiErrorCodes.values()) { | ||
if (error.code() == code) { | ||
return error; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
public int code() { return code; } | ||
|
||
public String description() { return description; } | ||
|
||
@Override | ||
public String toString() { return code + ": " + description; } | ||
|
||
} |
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