You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

error.go 31 kB

10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Squashed commit of the following: commit 0afcb843d7ffd596991c4885cab768273a6eb42c Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 17:13:29 2016 -0600 Removed Upload stats as the upload table is just a temporary table commit 7ecd73ff5535612d79d471409173ee7f1fcfa157 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:42:41 2016 -0600 Fix for CodeMirror mode commit c29b9ab531e2e7af0fb5db24dc17e51027dd1174 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 08:03:33 2016 -0600 Made tabbing in editor use spaces commit 23af384c53206a8a40e11e45bf49d7a149c4adcd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:56:46 2016 -0600 Fix for data-url commit cfb8a97591cb6fc0a92e49563b7b764c524db0e9 Merge: 7fc8a89 991ce42 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:42:53 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit 7fc8a89cb495478225b02d613e647f99a1489634 Merge: fd3d86c c03d040 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:40:00 2016 -0600 Merge branch 'feature-create-and-edit-repo-file' of github.com:richmahn/gogs into feature-create-and-edit-repo-file commit fd3d86ca6bbc02cfda566a504ffd6b03db4f75ef Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Sun Jul 31 07:39:44 2016 -0600 Code cleanup commit c03d0401c1049eeeccc32ab1f9c3303c130be5ee Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 29 15:38:23 2016 -0600 Code cleanup commit 98e1206ccf9f9a4503c020e3a7830cf9f861dfae Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:36:01 2016 -0600 Code cleanup and fixes commit c2895dc742f25f8412879c9fa15e18f27f42f194 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 18:24:04 2016 -0600 Fixes per Unknwon's requests commit 6aa7e46b21ad4c96e562daa2eac26a8fb408f8ef Merge: 889e9fa ad7ea88 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Thu Jul 28 17:13:43 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go modules/setting/setting.go commit 889e9faf1bd8559a4979c8f46005d488c1a234d4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:09:18 2016 -0600 Fix in gogs.js commit 47603edf223f147b114be65f3bd27bc1e88827a5 Merge: bb57912 cf85e9e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:07:36 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go public/js/gogs.js commit bb5791255867a71c11a77b639db050ad09c597a4 Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 22 14:02:18 2016 -0600 Update for using CodeMirror mode addon commit d10d128c51039be19e2af9c66c63db66a9f2ec6d Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 16:12:57 2016 -0600 Update for Edit commit 34a34982025144e3225e389f7849eb6273c1d576 Merge: fa1b752 1c7dcdd Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Tue Jul 19 11:52:02 2016 -0600 Merge remote-tracking branch 'gogits/develop' into feature-create-and-edit-repo-file Conflicts: modules/bindata/bindata.go commit fa1b752be29cd455c5184ddac2ffe80b3489763e Author: Richard Mahn <richard_mahn@wycliffeassociates.org> Date: Fri Jul 15 18:35:42 2016 -0600 Feature for editing, creating, uploading and deleting files
9 years ago
Oauth2 consumer (#679) * initial stuff for oauth2 login, fails on: * login button on the signIn page to start the OAuth2 flow and a callback for each provider Only GitHub is implemented for now * show login button only when the OAuth2 consumer is configured (and activated) * create macaron group for oauth2 urls * prevent net/http in modules (other then oauth2) * use a new data sessions oauth2 folder for storing the oauth2 session data * add missing 2FA when this is enabled on the user * add password option for OAuth2 user , for use with git over http and login to the GUI * add tip for registering a GitHub OAuth application * at startup of Gitea register all configured providers and also on adding/deleting of new providers * custom handling of errors in oauth2 request init + show better tip * add ExternalLoginUser model and migration script to add it to database * link a external account to an existing account (still need to handle wrong login and signup) and remove if user is removed * remove the linked external account from the user his settings * if user is unknown we allow him to register a new account or link it to some existing account * sign up with button on signin page (als change OAuth2Provider structure so we can store basic stuff about providers) * from gorilla/sessions docs: "Important Note: If you aren't using gorilla/mux, you need to wrap your handlers with context.ClearHandler as or else you will leak memory!" (we're using gorilla/sessions for storing oauth2 sessions) * use updated goth lib that now supports getting the OAuth2 user if the AccessToken is still valid instead of re-authenticating (prevent flooding the OAuth2 provider)
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996
  1. // Copyright 2015 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. import "fmt"
  6. // ErrNameReserved represents a "reserved name" error.
  7. type ErrNameReserved struct {
  8. Name string
  9. }
  10. // IsErrNameReserved checks if an error is a ErrNameReserved.
  11. func IsErrNameReserved(err error) bool {
  12. _, ok := err.(ErrNameReserved)
  13. return ok
  14. }
  15. func (err ErrNameReserved) Error() string {
  16. return fmt.Sprintf("name is reserved [name: %s]", err.Name)
  17. }
  18. // ErrNamePatternNotAllowed represents a "pattern not allowed" error.
  19. type ErrNamePatternNotAllowed struct {
  20. Pattern string
  21. }
  22. // IsErrNamePatternNotAllowed checks if an error is an
  23. // ErrNamePatternNotAllowed.
  24. func IsErrNamePatternNotAllowed(err error) bool {
  25. _, ok := err.(ErrNamePatternNotAllowed)
  26. return ok
  27. }
  28. func (err ErrNamePatternNotAllowed) Error() string {
  29. return fmt.Sprintf("name pattern is not allowed [pattern: %s]", err.Pattern)
  30. }
  31. // ____ ___
  32. // | | \______ ___________
  33. // | | / ___// __ \_ __ \
  34. // | | /\___ \\ ___/| | \/
  35. // |______//____ >\___ >__|
  36. // \/ \/
  37. // ErrUserAlreadyExist represents a "user already exists" error.
  38. type ErrUserAlreadyExist struct {
  39. Name string
  40. }
  41. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  42. func IsErrUserAlreadyExist(err error) bool {
  43. _, ok := err.(ErrUserAlreadyExist)
  44. return ok
  45. }
  46. func (err ErrUserAlreadyExist) Error() string {
  47. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  48. }
  49. // ErrUserNotExist represents a "UserNotExist" kind of error.
  50. type ErrUserNotExist struct {
  51. UID int64
  52. Name string
  53. KeyID int64
  54. }
  55. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  56. func IsErrUserNotExist(err error) bool {
  57. _, ok := err.(ErrUserNotExist)
  58. return ok
  59. }
  60. func (err ErrUserNotExist) Error() string {
  61. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  62. }
  63. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  64. type ErrEmailAlreadyUsed struct {
  65. Email string
  66. }
  67. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  68. func IsErrEmailAlreadyUsed(err error) bool {
  69. _, ok := err.(ErrEmailAlreadyUsed)
  70. return ok
  71. }
  72. func (err ErrEmailAlreadyUsed) Error() string {
  73. return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
  74. }
  75. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  76. type ErrOpenIDAlreadyUsed struct {
  77. OpenID string
  78. }
  79. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  80. func IsErrOpenIDAlreadyUsed(err error) bool {
  81. _, ok := err.(ErrOpenIDAlreadyUsed)
  82. return ok
  83. }
  84. func (err ErrOpenIDAlreadyUsed) Error() string {
  85. return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID)
  86. }
  87. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  88. type ErrUserOwnRepos struct {
  89. UID int64
  90. }
  91. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  92. func IsErrUserOwnRepos(err error) bool {
  93. _, ok := err.(ErrUserOwnRepos)
  94. return ok
  95. }
  96. func (err ErrUserOwnRepos) Error() string {
  97. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  98. }
  99. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  100. type ErrUserHasOrgs struct {
  101. UID int64
  102. }
  103. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  104. func IsErrUserHasOrgs(err error) bool {
  105. _, ok := err.(ErrUserHasOrgs)
  106. return ok
  107. }
  108. func (err ErrUserHasOrgs) Error() string {
  109. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  110. }
  111. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  112. type ErrUserNotAllowedCreateOrg struct {
  113. }
  114. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  115. func IsErrUserNotAllowedCreateOrg(err error) bool {
  116. _, ok := err.(ErrUserNotAllowedCreateOrg)
  117. return ok
  118. }
  119. func (err ErrUserNotAllowedCreateOrg) Error() string {
  120. return fmt.Sprintf("user is not allowed to create organizations")
  121. }
  122. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  123. type ErrReachLimitOfRepo struct {
  124. Limit int
  125. }
  126. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  127. func IsErrReachLimitOfRepo(err error) bool {
  128. _, ok := err.(ErrReachLimitOfRepo)
  129. return ok
  130. }
  131. func (err ErrReachLimitOfRepo) Error() string {
  132. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  133. }
  134. // __ __.__ __ .__
  135. // / \ / \__| | _|__|
  136. // \ \/\/ / | |/ / |
  137. // \ /| | <| |
  138. // \__/\ / |__|__|_ \__|
  139. // \/ \/
  140. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  141. type ErrWikiAlreadyExist struct {
  142. Title string
  143. }
  144. // IsErrWikiAlreadyExist checks if an error is a ErrWikiAlreadyExist.
  145. func IsErrWikiAlreadyExist(err error) bool {
  146. _, ok := err.(ErrWikiAlreadyExist)
  147. return ok
  148. }
  149. func (err ErrWikiAlreadyExist) Error() string {
  150. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  151. }
  152. // __________ ___. .__ .__ ____ __.
  153. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  154. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  155. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  156. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  157. // \/ \/ \/ \/\/
  158. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  159. type ErrKeyUnableVerify struct {
  160. Result string
  161. }
  162. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  163. func IsErrKeyUnableVerify(err error) bool {
  164. _, ok := err.(ErrKeyUnableVerify)
  165. return ok
  166. }
  167. func (err ErrKeyUnableVerify) Error() string {
  168. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  169. }
  170. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  171. type ErrKeyNotExist struct {
  172. ID int64
  173. }
  174. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  175. func IsErrKeyNotExist(err error) bool {
  176. _, ok := err.(ErrKeyNotExist)
  177. return ok
  178. }
  179. func (err ErrKeyNotExist) Error() string {
  180. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  181. }
  182. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  183. type ErrKeyAlreadyExist struct {
  184. OwnerID int64
  185. Fingerprint string
  186. Content string
  187. }
  188. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  189. func IsErrKeyAlreadyExist(err error) bool {
  190. _, ok := err.(ErrKeyAlreadyExist)
  191. return ok
  192. }
  193. func (err ErrKeyAlreadyExist) Error() string {
  194. return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]",
  195. err.OwnerID, err.Fingerprint, err.Content)
  196. }
  197. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  198. type ErrKeyNameAlreadyUsed struct {
  199. OwnerID int64
  200. Name string
  201. }
  202. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  203. func IsErrKeyNameAlreadyUsed(err error) bool {
  204. _, ok := err.(ErrKeyNameAlreadyUsed)
  205. return ok
  206. }
  207. func (err ErrKeyNameAlreadyUsed) Error() string {
  208. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  209. }
  210. // ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
  211. type ErrGPGNoEmailFound struct {
  212. FailedEmails []string
  213. }
  214. // IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
  215. func IsErrGPGNoEmailFound(err error) bool {
  216. _, ok := err.(ErrGPGNoEmailFound)
  217. return ok
  218. }
  219. func (err ErrGPGNoEmailFound) Error() string {
  220. return fmt.Sprintf("none of the emails attached to the GPG key could be found: %v", err.FailedEmails)
  221. }
  222. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  223. type ErrGPGKeyParsing struct {
  224. ParseError error
  225. }
  226. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  227. func IsErrGPGKeyParsing(err error) bool {
  228. _, ok := err.(ErrGPGKeyParsing)
  229. return ok
  230. }
  231. func (err ErrGPGKeyParsing) Error() string {
  232. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  233. }
  234. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  235. type ErrGPGKeyNotExist struct {
  236. ID int64
  237. }
  238. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  239. func IsErrGPGKeyNotExist(err error) bool {
  240. _, ok := err.(ErrGPGKeyNotExist)
  241. return ok
  242. }
  243. func (err ErrGPGKeyNotExist) Error() string {
  244. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  245. }
  246. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  247. type ErrGPGKeyIDAlreadyUsed struct {
  248. KeyID string
  249. }
  250. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  251. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  252. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  253. return ok
  254. }
  255. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  256. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  257. }
  258. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  259. type ErrGPGKeyAccessDenied struct {
  260. UserID int64
  261. KeyID int64
  262. }
  263. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  264. func IsErrGPGKeyAccessDenied(err error) bool {
  265. _, ok := err.(ErrGPGKeyAccessDenied)
  266. return ok
  267. }
  268. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  269. func (err ErrGPGKeyAccessDenied) Error() string {
  270. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  271. err.UserID, err.KeyID)
  272. }
  273. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  274. type ErrKeyAccessDenied struct {
  275. UserID int64
  276. KeyID int64
  277. Note string
  278. }
  279. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  280. func IsErrKeyAccessDenied(err error) bool {
  281. _, ok := err.(ErrKeyAccessDenied)
  282. return ok
  283. }
  284. func (err ErrKeyAccessDenied) Error() string {
  285. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  286. err.UserID, err.KeyID, err.Note)
  287. }
  288. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  289. type ErrDeployKeyNotExist struct {
  290. ID int64
  291. KeyID int64
  292. RepoID int64
  293. }
  294. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  295. func IsErrDeployKeyNotExist(err error) bool {
  296. _, ok := err.(ErrDeployKeyNotExist)
  297. return ok
  298. }
  299. func (err ErrDeployKeyNotExist) Error() string {
  300. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  301. }
  302. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  303. type ErrDeployKeyAlreadyExist struct {
  304. KeyID int64
  305. RepoID int64
  306. }
  307. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  308. func IsErrDeployKeyAlreadyExist(err error) bool {
  309. _, ok := err.(ErrDeployKeyAlreadyExist)
  310. return ok
  311. }
  312. func (err ErrDeployKeyAlreadyExist) Error() string {
  313. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  314. }
  315. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  316. type ErrDeployKeyNameAlreadyUsed struct {
  317. RepoID int64
  318. Name string
  319. }
  320. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  321. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  322. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  323. return ok
  324. }
  325. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  326. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  327. }
  328. // _____ ___________ __
  329. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  330. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  331. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  332. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  333. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  334. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  335. type ErrAccessTokenNotExist struct {
  336. SHA string
  337. }
  338. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  339. func IsErrAccessTokenNotExist(err error) bool {
  340. _, ok := err.(ErrAccessTokenNotExist)
  341. return ok
  342. }
  343. func (err ErrAccessTokenNotExist) Error() string {
  344. return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
  345. }
  346. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  347. type ErrAccessTokenEmpty struct {
  348. }
  349. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  350. func IsErrAccessTokenEmpty(err error) bool {
  351. _, ok := err.(ErrAccessTokenEmpty)
  352. return ok
  353. }
  354. func (err ErrAccessTokenEmpty) Error() string {
  355. return fmt.Sprintf("access token is empty")
  356. }
  357. // ________ .__ __ .__
  358. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  359. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  360. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  361. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  362. // \/ /_____/ \/ \/ \/ \/ \/
  363. // ErrOrgNotExist represents a "OrgNotExist" kind of error.
  364. type ErrOrgNotExist struct {
  365. ID int64
  366. Name string
  367. }
  368. // IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
  369. func IsErrOrgNotExist(err error) bool {
  370. _, ok := err.(ErrOrgNotExist)
  371. return ok
  372. }
  373. func (err ErrOrgNotExist) Error() string {
  374. return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
  375. }
  376. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  377. type ErrLastOrgOwner struct {
  378. UID int64
  379. }
  380. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  381. func IsErrLastOrgOwner(err error) bool {
  382. _, ok := err.(ErrLastOrgOwner)
  383. return ok
  384. }
  385. func (err ErrLastOrgOwner) Error() string {
  386. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  387. }
  388. // __________ .__ __
  389. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  390. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  391. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  392. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  393. // \/ \/|__| \/ \/
  394. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  395. type ErrRepoNotExist struct {
  396. ID int64
  397. UID int64
  398. Name string
  399. }
  400. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  401. func IsErrRepoNotExist(err error) bool {
  402. _, ok := err.(ErrRepoNotExist)
  403. return ok
  404. }
  405. func (err ErrRepoNotExist) Error() string {
  406. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, name: %s]", err.ID, err.UID, err.Name)
  407. }
  408. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  409. type ErrRepoAlreadyExist struct {
  410. Uname string
  411. Name string
  412. }
  413. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  414. func IsErrRepoAlreadyExist(err error) bool {
  415. _, ok := err.(ErrRepoAlreadyExist)
  416. return ok
  417. }
  418. func (err ErrRepoAlreadyExist) Error() string {
  419. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  420. }
  421. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  422. type ErrRepoRedirectNotExist struct {
  423. OwnerID int64
  424. RepoName string
  425. }
  426. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
  427. func IsErrRepoRedirectNotExist(err error) bool {
  428. _, ok := err.(ErrRepoRedirectNotExist)
  429. return ok
  430. }
  431. func (err ErrRepoRedirectNotExist) Error() string {
  432. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  433. }
  434. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  435. type ErrInvalidCloneAddr struct {
  436. IsURLError bool
  437. IsInvalidPath bool
  438. IsPermissionDenied bool
  439. }
  440. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  441. func IsErrInvalidCloneAddr(err error) bool {
  442. _, ok := err.(ErrInvalidCloneAddr)
  443. return ok
  444. }
  445. func (err ErrInvalidCloneAddr) Error() string {
  446. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  447. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  448. }
  449. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  450. type ErrUpdateTaskNotExist struct {
  451. UUID string
  452. }
  453. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  454. func IsErrUpdateTaskNotExist(err error) bool {
  455. _, ok := err.(ErrUpdateTaskNotExist)
  456. return ok
  457. }
  458. func (err ErrUpdateTaskNotExist) Error() string {
  459. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  460. }
  461. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  462. type ErrReleaseAlreadyExist struct {
  463. TagName string
  464. }
  465. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  466. func IsErrReleaseAlreadyExist(err error) bool {
  467. _, ok := err.(ErrReleaseAlreadyExist)
  468. return ok
  469. }
  470. func (err ErrReleaseAlreadyExist) Error() string {
  471. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  472. }
  473. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  474. type ErrReleaseNotExist struct {
  475. ID int64
  476. TagName string
  477. }
  478. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  479. func IsErrReleaseNotExist(err error) bool {
  480. _, ok := err.(ErrReleaseNotExist)
  481. return ok
  482. }
  483. func (err ErrReleaseNotExist) Error() string {
  484. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  485. }
  486. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  487. type ErrInvalidTagName struct {
  488. TagName string
  489. }
  490. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  491. func IsErrInvalidTagName(err error) bool {
  492. _, ok := err.(ErrInvalidTagName)
  493. return ok
  494. }
  495. func (err ErrInvalidTagName) Error() string {
  496. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  497. }
  498. // ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
  499. type ErrRepoFileAlreadyExist struct {
  500. FileName string
  501. }
  502. // IsErrRepoFileAlreadyExist checks if an error is a ErrRepoFileAlreadyExist.
  503. func IsErrRepoFileAlreadyExist(err error) bool {
  504. _, ok := err.(ErrRepoFileAlreadyExist)
  505. return ok
  506. }
  507. func (err ErrRepoFileAlreadyExist) Error() string {
  508. return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
  509. }
  510. // __________ .__
  511. // \______ \____________ ____ ____ | |__
  512. // | | _/\_ __ \__ \ / \_/ ___\| | \
  513. // | | \ | | \// __ \| | \ \___| Y \
  514. // |______ / |__| (____ /___| /\___ >___| /
  515. // \/ \/ \/ \/ \/
  516. // ErrBranchNotExist represents a "BranchNotExist" kind of error.
  517. type ErrBranchNotExist struct {
  518. Name string
  519. }
  520. // IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
  521. func IsErrBranchNotExist(err error) bool {
  522. _, ok := err.(ErrBranchNotExist)
  523. return ok
  524. }
  525. func (err ErrBranchNotExist) Error() string {
  526. return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
  527. }
  528. // __ __ ___. .__ __
  529. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  530. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  531. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  532. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  533. // \/ \/ \/ \/ \/
  534. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  535. type ErrWebhookNotExist struct {
  536. ID int64
  537. }
  538. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  539. func IsErrWebhookNotExist(err error) bool {
  540. _, ok := err.(ErrWebhookNotExist)
  541. return ok
  542. }
  543. func (err ErrWebhookNotExist) Error() string {
  544. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  545. }
  546. // .___
  547. // | | ______ ________ __ ____
  548. // | |/ ___// ___/ | \_/ __ \
  549. // | |\___ \ \___ \| | /\ ___/
  550. // |___/____ >____ >____/ \___ >
  551. // \/ \/ \/
  552. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  553. type ErrIssueNotExist struct {
  554. ID int64
  555. RepoID int64
  556. Index int64
  557. }
  558. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  559. func IsErrIssueNotExist(err error) bool {
  560. _, ok := err.(ErrIssueNotExist)
  561. return ok
  562. }
  563. func (err ErrIssueNotExist) Error() string {
  564. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  565. }
  566. // __________ .__ .__ __________ __
  567. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  568. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  569. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  570. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  571. // \/ \/ |__| \/ \/
  572. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  573. type ErrPullRequestNotExist struct {
  574. ID int64
  575. IssueID int64
  576. HeadRepoID int64
  577. BaseRepoID int64
  578. HeadBranch string
  579. BaseBranch string
  580. }
  581. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  582. func IsErrPullRequestNotExist(err error) bool {
  583. _, ok := err.(ErrPullRequestNotExist)
  584. return ok
  585. }
  586. func (err ErrPullRequestNotExist) Error() string {
  587. return fmt.Sprintf("pull request does not exist [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  588. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  589. }
  590. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  591. type ErrPullRequestAlreadyExists struct {
  592. ID int64
  593. IssueID int64
  594. HeadRepoID int64
  595. BaseRepoID int64
  596. HeadBranch string
  597. BaseBranch string
  598. }
  599. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  600. func IsErrPullRequestAlreadyExists(err error) bool {
  601. _, ok := err.(ErrPullRequestAlreadyExists)
  602. return ok
  603. }
  604. // Error does pretty-printing :D
  605. func (err ErrPullRequestAlreadyExists) Error() string {
  606. return fmt.Sprintf("pull request already exists for these targets [id: %d, issue_id: %d, head_repo_id: %d, base_repo_id: %d, head_branch: %s, base_branch: %s]",
  607. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  608. }
  609. // _________ __
  610. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  611. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  612. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  613. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  614. // \/ \/ \/ \/ \/
  615. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  616. type ErrCommentNotExist struct {
  617. ID int64
  618. IssueID int64
  619. }
  620. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  621. func IsErrCommentNotExist(err error) bool {
  622. _, ok := err.(ErrCommentNotExist)
  623. return ok
  624. }
  625. func (err ErrCommentNotExist) Error() string {
  626. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  627. }
  628. // .____ ___. .__
  629. // | | _____ \_ |__ ____ | |
  630. // | | \__ \ | __ \_/ __ \| |
  631. // | |___ / __ \| \_\ \ ___/| |__
  632. // |_______ (____ /___ /\___ >____/
  633. // \/ \/ \/ \/
  634. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  635. type ErrLabelNotExist struct {
  636. LabelID int64
  637. RepoID int64
  638. }
  639. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  640. func IsErrLabelNotExist(err error) bool {
  641. _, ok := err.(ErrLabelNotExist)
  642. return ok
  643. }
  644. func (err ErrLabelNotExist) Error() string {
  645. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  646. }
  647. // _____ .__.__ __
  648. // / \ |__| | ____ _______/ |_ ____ ____ ____
  649. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  650. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  651. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  652. // \/ \/ \/ \/ \/
  653. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  654. type ErrMilestoneNotExist struct {
  655. ID int64
  656. RepoID int64
  657. }
  658. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  659. func IsErrMilestoneNotExist(err error) bool {
  660. _, ok := err.(ErrMilestoneNotExist)
  661. return ok
  662. }
  663. func (err ErrMilestoneNotExist) Error() string {
  664. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  665. }
  666. // _____ __ __ .__ __
  667. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  668. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  669. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  670. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  671. // \/ \/ \/ \/ \/ \/ \/
  672. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  673. type ErrAttachmentNotExist struct {
  674. ID int64
  675. UUID string
  676. }
  677. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  678. func IsErrAttachmentNotExist(err error) bool {
  679. _, ok := err.(ErrAttachmentNotExist)
  680. return ok
  681. }
  682. func (err ErrAttachmentNotExist) Error() string {
  683. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  684. }
  685. // .____ .__ _________
  686. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  687. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  688. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  689. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  690. // \/ /_____/ \/ \/ \/ \/
  691. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  692. type ErrLoginSourceNotExist struct {
  693. ID int64
  694. }
  695. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  696. func IsErrLoginSourceNotExist(err error) bool {
  697. _, ok := err.(ErrLoginSourceNotExist)
  698. return ok
  699. }
  700. func (err ErrLoginSourceNotExist) Error() string {
  701. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  702. }
  703. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  704. type ErrLoginSourceAlreadyExist struct {
  705. Name string
  706. }
  707. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  708. func IsErrLoginSourceAlreadyExist(err error) bool {
  709. _, ok := err.(ErrLoginSourceAlreadyExist)
  710. return ok
  711. }
  712. func (err ErrLoginSourceAlreadyExist) Error() string {
  713. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  714. }
  715. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  716. type ErrLoginSourceInUse struct {
  717. ID int64
  718. }
  719. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  720. func IsErrLoginSourceInUse(err error) bool {
  721. _, ok := err.(ErrLoginSourceInUse)
  722. return ok
  723. }
  724. func (err ErrLoginSourceInUse) Error() string {
  725. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  726. }
  727. // ___________
  728. // \__ ___/___ _____ _____
  729. // | |_/ __ \\__ \ / \
  730. // | |\ ___/ / __ \| Y Y \
  731. // |____| \___ >____ /__|_| /
  732. // \/ \/ \/
  733. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  734. type ErrTeamAlreadyExist struct {
  735. OrgID int64
  736. Name string
  737. }
  738. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  739. func IsErrTeamAlreadyExist(err error) bool {
  740. _, ok := err.(ErrTeamAlreadyExist)
  741. return ok
  742. }
  743. func (err ErrTeamAlreadyExist) Error() string {
  744. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  745. }
  746. //
  747. // Two-factor authentication
  748. //
  749. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  750. type ErrTwoFactorNotEnrolled struct {
  751. UID int64
  752. }
  753. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  754. func IsErrTwoFactorNotEnrolled(err error) bool {
  755. _, ok := err.(ErrTwoFactorNotEnrolled)
  756. return ok
  757. }
  758. func (err ErrTwoFactorNotEnrolled) Error() string {
  759. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  760. }
  761. // ____ ___ .__ .___
  762. // | | \______ | | _________ __| _/
  763. // | | /\____ \| | / _ \__ \ / __ |
  764. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  765. // |______/ | __/|____/\____(____ /\____ |
  766. // |__| \/ \/
  767. //
  768. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  769. type ErrUploadNotExist struct {
  770. ID int64
  771. UUID string
  772. }
  773. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  774. func IsErrUploadNotExist(err error) bool {
  775. _, ok := err.(ErrAttachmentNotExist)
  776. return ok
  777. }
  778. func (err ErrUploadNotExist) Error() string {
  779. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  780. }
  781. // ___________ __ .__ .____ .__ ____ ___
  782. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  783. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  784. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  785. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  786. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  787. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  788. type ErrExternalLoginUserAlreadyExist struct {
  789. ExternalID string
  790. UserID int64
  791. LoginSourceID int64
  792. }
  793. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  794. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  795. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  796. return ok
  797. }
  798. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  799. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  800. }
  801. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  802. type ErrExternalLoginUserNotExist struct {
  803. UserID int64
  804. LoginSourceID int64
  805. }
  806. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  807. func IsErrExternalLoginUserNotExist(err error) bool {
  808. _, ok := err.(ErrExternalLoginUserNotExist)
  809. return ok
  810. }
  811. func (err ErrExternalLoginUserNotExist) Error() string {
  812. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  813. }