tickets
All repositories: gitoria
2.8 KB
// lib/problems.hl — WHAT THE ERROR PAGES SAY (tickets#42). /connect and /login/callback are function routes: they decide, they do not draw.// A refusal redirects to a PAGE of the app (components/problem.hl: the same shell, header and theme) and names the reason by a SHORT CODE in the// path (`/login/failed/<code>`, `/connect/failed/<code>`); the sentence is chosen HERE from the code, so no text of the URL (or of ident, or of// the app asking to connect) is ever rendered: an unknown code gets the general sentence.// the sentence and the heading of a code: { title, text, back, backText }static problemOf = (code) => {let title = 'Something went wrong'let text = 'That did not work. Please try again.'let back = '/'let backText = 'back to the tickets'if (code == 'login-method') { title = 'Login failed' text = 'The login return only accepts a normal page visit.' }if (code == 'login-no-code') { title = 'Login failed' text = 'Ident sent no login code. Please sign in again.' }if (code == 'login-refused') { title = 'Login failed' text = 'Ident did not accept the login code. Please sign in again.' }if (code == 'login-no-answer') { title = 'Login failed' text = 'Ident did not answer. Please try again in a moment.' }if (code == 'login-not-set-up') { title = 'Login failed' text = 'Login is not set up on this server.' }if (code == 'login-no-user') { title = 'Login failed' text = 'Your user could not be stored. Please try again.' }if (code == 'login-invite') { title = 'Invite failed' text = 'The invite could not be used. It may be used up, or meant for a project that does not exist any more. Ask for a new one.' }if (code == 'connect-method') { title = 'Connect failed' text = 'The connection request only accepts a normal page visit.' }if (code == 'connect-refused') { title = 'Connect failed' text = 'The app sent a connection request that is not valid: its name or its return address was not accepted. Start again from the app.' }if (code == 'connect-busy') { title = 'Connect failed' text = 'Too many connection requests are waiting. Try again in a few minutes.' }if (code == 'connect-store') { title = 'Connect failed' text = 'The connection request could not be stored. Please try again.' }return { title = title text = text back = back backText = backText }}// the code an ident exchange error stands for (users.hl exchangeCode answers its reason as text)static loginCodeOf = (error) => {if (error == 'ident did not answer') { return 'login-no-answer' }if (error != null && error.indexOf('not set up') >= 0) { return 'login-not-set-up' }return 'login-refused'}// the code a refused connection request stands for (connections.hl createRequest)static connectCodeOf = (r) => {if (r.busy == true) { return 'connect-busy' }if (r.error != null && r.error.startsWith('could not store')) { return 'connect-store' }return 'connect-refused'}
Branches
Latest commits
- 5d144817Merge branch 'records-t40' into mainTickets
- 44ee6f06|||PR records: #43 #45 livemre
- b8fdeee9Merge branch 'p39-routes' into mainTickets
- a0187a0a|||PR Remove redundant route-order loopmre
- 369e4b9cMerge branch 'k40-lists' into mainTickets
- 9af8e780|||PR Use keyed list mutations for live ticket updatesmre
- 610d8e8aMerge branch 'records-t39' into mainTickets
- 32bcdf24|||PR records: GO P39 K40mre
- 4123c6d1Merge branch 'records-t38' into mainTickets
- cd3641a1|||PR records: day72 deploy live, tickets closedmre
- 7d44d852Merge branch 'records-t37' into mainTickets
- 926f7061|||PR records: merges, D36 deploymre
- bf58534eMerge branch 'l33-final' into mainTickets
- 759a9ac3|||PR thin login (tickets#46, #45): merge main, route entry cleanupmre
- 239436d8Merge remote-tracking branch 'origin/main' into l33-finalmre
- 5822cb3aMerge branch 'o34-clean' into mainTickets
- 0870653c|||PR offline note from __hlOnline, no polling (tickets#41)mre
- 14cf96b4Merge branch 'records-t36' into mainTickets
- 07749fa1|||PR records: day72 + #40 mergedmre
- ecd7e226|||PR Consolidate login and move handler logic into topic libraries (partial)mre