[docs] add error response for getBlockTime RPC call (#31653)

Co-authored-by: Callum McIntyre <callum.mcintyre@solana.com>
This commit is contained in:
Callum McIntyre 2023-05-16 23:02:24 +01:00 committed by GitHub
parent 7c6478da8f
commit 6c1cdb57c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 1 deletions

View File

@ -34,7 +34,6 @@ in a set of recent blocks recorded on the ledger.
### Result:
- `<i64>` - estimated production time, as Unix timestamp (seconds since the Unix epoch)
- `<null>` - timestamp is not available for this block
</CodeParams>
@ -54,6 +53,8 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
### Response:
When a block time is available:
```json
{
"jsonrpc": "2.0",
@ -62,6 +63,19 @@ curl http://localhost:8899 -X POST -H "Content-Type: application/json" -d '
}
```
When a block time is not available:
```json
{
"jsonrpc": "2.0",
"error": {
"code": -32004,
"message": "Block not available for slot 150"
},
"id": 1
}
```
</CodeSnippets>
</DocSideBySide>
</DocBlock>