Skip to content

Commit 422df9a

Browse files
committed
Handle 404, 403, 401, and 400 errors separately
1 parent 81915ae commit 422df9a

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/main/java/org/quantumbadger/redreader/common/General.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,15 @@ object General {
308308
if(status == 404) {
309309
title = R.string.error_404_title
310310
message = R.string.error_404_message
311-
} else {
311+
} else if (status == 403) {
312312
title = R.string.error_403_title
313313
message = R.string.error_403_message
314+
} else if (status == 401) {
315+
title = R.string.error_401_title
316+
message = R.string.error_401_message
317+
} else {
318+
title = R.string.error_400_title
319+
message = R.string.error_400_message
314320
}
315321
}
316322
}

src/main/res/values/strings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1902,4 +1902,10 @@
19021902
<string name="album_grid_pref_horizontal_padding">Horizontal padding</string>
19031903

19041904
<string name="album_pref_compact_title">Compact title</string>
1905+
1906+
<!-- 2024-11-24 -->
1907+
<string name="error_401_title">Unauthorized</string>
1908+
<string name="error_401_message">Reddit says that you are not logged in or have provided invalid credentials.</string>
1909+
<string name="error_400_title">Bad Request</string>
1910+
<string name="error_400_message">Reddit says that you have submitted something invalid.</string>
19051911
</resources>

0 commit comments

Comments
 (0)