softwaremill / softwaremill/sttp

Should TryBackend be used by default in the code examples?

Open
#2,567 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.5k
Forks
338
Avg merge
8h 59m
Merged PRs (30d)
13

Description

STTP is agnostic to the backends used. However, as a Scala library, I think it should favor returning Try (or Either) over throwing exceptions by default in the code examples / documentation (unless explicitly using a yolo-backend like quick). This would be more consistent with the rest of the API that returns Either already (e.g. when handling the response). Currently the DefaultSyncBackend is used in the examples which throws exceptions.

If someone wants to opt into throwing exceptions, they can easily do that.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the examples documentation at the linked examples page, focusing on the current use of DefaultSyncBackend and the available TryBackend and quick options. Confirm which backend the examples should demonstrate by default and update the examples so their error-handling behavior matches the chosen convention; done means the documentation consistently explains any explicit opt-in to throwing exceptions.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.