File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
internal/handlers/private Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,13 @@ func Version(c *fiber.Ctx) error {
3333 if err == sql .ErrNoRows {
3434 version = update .VersionInfo ()
3535
36+ // Try to fetch latest release, but don't fail if GitHub API is unavailable
3637 release , err := update .FetchLatestRelease (context .Background (), "shurco" , "litecart" )
3738 if err != nil {
39+ // Log the error but continue without update information
40+ // This prevents blocking access when GitHub API is unavailable
3841 log .ErrorStack (err )
39- return webutil .StatusInternalServerError (c )
40- }
41-
42- if version .CurrentVersion != release .Name {
42+ } else if version .CurrentVersion != release .Name {
4343 version .NewVersion = release .Name
4444 version .ReleaseURL = release .GetUrl ()
4545 }
Original file line number Diff line number Diff line change @@ -37,10 +37,6 @@ export const load: LayoutLoad = async ({ url, fetch }) => {
3737 if ( versionData ?. success ) {
3838 isAuthenticated = true
3939 }
40- } else if ( versionResponse . status === 500 ) {
41- // Server error - likely means app is not installed
42- // Backend should handle this, but for client-side navigation, redirect to install
43- throw redirect ( 302 , `${ base } /install` )
4440 } else if ( versionResponse . status === 400 || versionResponse . status === 401 || versionResponse . status === 403 ) {
4541 // 400 = missing/malformed token (app installed but not authenticated)
4642 // 401/403 = unauthorized (app installed but not authenticated)
@@ -72,9 +68,6 @@ export const load: LayoutLoad = async ({ url, fetch }) => {
7268 // 400 = missing/malformed token (app installed but not authenticated)
7369 // 401/403 = unauthorized (app installed but not authenticated)
7470 throw redirect ( 302 , `${ base } /signin` )
75- } else if ( productsResponse . status === 500 ) {
76- // Server error - likely means app is not installed
77- throw redirect ( 302 , `${ base } /install` )
7871 }
7972 } catch ( error ) {
8073 // If it's already a redirect, rethrow it
You can’t perform that action at this time.
0 commit comments