Skip to content

Commit

Permalink
Fix trivial mistake in error message. (#3952)
Browse files Browse the repository at this point in the history
## Motivation and Context
This commit fixes a bad error message.

## Description
In `read_profile_line()`, when `.strip_prefix('[')` fails, the original
error message was `Profile definition must start with ]`, which is
obviously wrong. This commit fixes the error message to be `Profile
definition must start with '['`, which corrects the mistake in the
original error message (fixing `]` to be `[`), and adds the single
quotes to match the formatting of the error message used when
`.strip_suffix(']')` fails (`Profile definition must end with ']'`).

## Testing
No testing is needed here; this is solely a change to a hardcoded error
message string.

## Checklist
This is a trivial fix. Is it really interesting enough to mention in a
changelog?

- [ ] For changes to the smithy-rs codegen or runtime crates, I have
created a changelog entry Markdown file in the `.changelog` directory,
specifying "client," "server," or both in the `applies_to` key.
- [ ] For changes to the AWS SDK, generated SDK code, or SDK runtime
crates, I have created a changelog entry Markdown file in the
`.changelog` directory, specifying "aws-sdk-rust" in the `applies_to`
key.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._

---------

Co-authored-by: Landon James <[email protected]>
  • Loading branch information
deven and landonxjames authored Dec 28, 2024
1 parent 916cfb6 commit 6cc3ed7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion aws/rust-runtime/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aws-runtime"
version = "1.5.2"
version = "1.5.3"
authors = ["AWS Rust SDK Team <[email protected]>"]
description = "Runtime support code for the AWS SDK. This crate isn't intended to be used directly."
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion aws/rust-runtime/aws-runtime/src/env_config/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl<'a> Parser<'a> {
let line = prepare_line(line, false);
let profile_name = line
.strip_prefix('[')
.ok_or_else(|| self.make_error("Profile definition must start with ]"))?
.ok_or_else(|| self.make_error("Profile definition must start with '['"))?
.strip_suffix(']')
.ok_or_else(|| self.make_error("Profile definition must end with ']'"))?;
if !self.data.contains_key(profile_name) {
Expand Down

0 comments on commit 6cc3ed7

Please sign in to comment.