gitoria

tickets

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain5d144817Merge branch 'records-t40' into mainTicketsmain/lib/problems.hl

2.8 KB

  1. // lib/problems.hl — WHAT THE ERROR PAGES SAY (tickets#42). /connect and /login/callback are function routes: they decide, they do not draw.
  2. // 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
  3. // 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
  4. // the app asking to connect) is ever rendered: an unknown code gets the general sentence.
  5. // the sentence and the heading of a code: { title, text, back, backText }
  6. static problemOf = (code) => {
  7. let title = 'Something went wrong'
  8. let text = 'That did not work. Please try again.'
  9. let back = '/'
  10. let backText = 'back to the tickets'
  11. if (code == 'login-method') { title = 'Login failed' text = 'The login return only accepts a normal page visit.' }
  12. if (code == 'login-no-code') { title = 'Login failed' text = 'Ident sent no login code. Please sign in again.' }
  13. if (code == 'login-refused') { title = 'Login failed' text = 'Ident did not accept the login code. Please sign in again.' }
  14. if (code == 'login-no-answer') { title = 'Login failed' text = 'Ident did not answer. Please try again in a moment.' }
  15. if (code == 'login-not-set-up') { title = 'Login failed' text = 'Login is not set up on this server.' }
  16. if (code == 'login-no-user') { title = 'Login failed' text = 'Your user could not be stored. Please try again.' }
  17. 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.' }
  18. if (code == 'connect-method') { title = 'Connect failed' text = 'The connection request only accepts a normal page visit.' }
  19. 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.' }
  20. if (code == 'connect-busy') { title = 'Connect failed' text = 'Too many connection requests are waiting. Try again in a few minutes.' }
  21. if (code == 'connect-store') { title = 'Connect failed' text = 'The connection request could not be stored. Please try again.' }
  22. return { title = title text = text back = back backText = backText }
  23. }
  24. // the code an ident exchange error stands for (users.hl exchangeCode answers its reason as text)
  25. static loginCodeOf = (error) => {
  26. if (error == 'ident did not answer') { return 'login-no-answer' }
  27. if (error != null && error.indexOf('not set up') >= 0) { return 'login-not-set-up' }
  28. return 'login-refused'
  29. }
  30. // the code a refused connection request stands for (connections.hl createRequest)
  31. static connectCodeOf = (r) => {
  32. if (r.busy == true) { return 'connect-busy' }
  33. if (r.error != null && r.error.startsWith('could not store')) { return 'connect-store' }
  34. return 'connect-refused'
  35. }

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