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

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