fix(libSceNpTrophy2): return the icon error code instead of throwing #15314

Open
MarcZX10 wants to merge 3 commits from upstream-pr/15314 into main
MarcZX10 commented 2026-11-02 23:28:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T23:28:37Z.


What

sceNpTrophy2GetGameIcon, sceNpTrophy2GetGroupIcon and sceNpTrophy2GetTrophyIcon threw a C++ exception when no icon file existed. They now return SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND with the size zeroed. That error is the not-found answer by design, matching the sibling sceNpTrophy2GetRewardIcon and the debt entry that describes these functions. Its effect on a title is not measured here.

Commits:

  • da29f8cf3f fix(libSceNpTrophy2): return the icon error code instead of throwing
  • 96a5aaec7d test(libSceNpTrophy2): cover the game, group and trophy icon error codes

Tested

  • Host: Linux, archive build, lane 2, on the final head after rebasing onto current main.
  • ctest -R '^guest_nptrophy2$': 1 of 1 passed (guest_nptrophy2).
  • tools/check_conventions.py --base upstream/main and git diff --check upstream/main: clean.

Not verified

  • Whether the console returns this code rather than an error is not measured here; the change follows the debt entry.
  • Negative control (old code, new test) not run.
  • Not run on Windows or macOS.
  • #15019 changes TrophyStore.cpp and its tests, not these icon files.

Checklist

  • Based on current main; no other open PR changes these icon functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5129096120 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15314). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T23:28:37Z. --- ### What `sceNpTrophy2GetGameIcon`, `sceNpTrophy2GetGroupIcon` and `sceNpTrophy2GetTrophyIcon` threw a C++ exception when no icon file existed. They now return `SCE_NP_TROPHY2_ERROR_ICON_FILE_NOT_FOUND` with the size zeroed. That error is the not-found answer by design, matching the sibling `sceNpTrophy2GetRewardIcon` and the debt entry that describes these functions. Its effect on a title is not measured here. Commits: - da29f8cf3f fix(libSceNpTrophy2): return the icon error code instead of throwing - 96a5aaec7d test(libSceNpTrophy2): cover the game, group and trophy icon error codes ### Tested - Host: Linux, archive build, lane 2, on the final head after rebasing onto current `main`. - `ctest -R '^guest_nptrophy2$'`: 1 of 1 passed (`guest_nptrophy2`). - `tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main`: clean. ### Not verified - Whether the console returns this code rather than an error is not measured here; the change follows the debt entry. - Negative control (old code, new test) not run. - Not run on Windows or macOS. - #15019 changes `TrophyStore.cpp` and its tests, not these icon files. ### Checklist - [x] Based on current `main`; no other open PR changes these icon functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/15314:upstream-pr/15314'
git switch 'upstream-pr/15314'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/15314'
git switch 'upstream-pr/15314'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/15314'
git switch 'upstream-pr/15314'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/15314'
git switch 'main'
git merge --squash 'upstream-pr/15314'
git switch 'main'
git merge --ff-only 'upstream-pr/15314'
git switch 'main'
git merge 'upstream-pr/15314'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!15314
No description provided.