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 37 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
Feature: Timetracking (#2211) * Added comment's hashtag to url for mail notifications. * Added explanation to return statement + documentation. * Replacing in-line link generation with HTMLURL. (+gofmt) * Replaced action-based model with nil-based model. (+gofmt) * Replaced mailIssueActionToParticipants with mailIssueCommentToParticipants. * Updating comment for mailIssueCommentToParticipants * Added link to comment in "Dashboard" * Deleting feed entry if a comment is going to be deleted * Added migration * Added improved migration to add a CommentID column to action. * Added improved links to comments in feed entries. * Fixes #1956 by filtering for deleted comments that are referenced in actions. * Introducing "IsDeleted" column to action. * Adding design draft (not functional) * Adding database models for stopwatches and trackedtimes * See go-gitea/gitea#967 * Adding design draft (not functional) * Adding translations and improving design * Implementing stopwatch (for timetracking) * Make UI functional * Add hints in timeline for time tracking events * Implementing timetracking feature * Adding "Add time manual" option * Improved stopwatch * Created report of total spent time by user * Only showing total time spent if theire is something to show. * Adding license headers. * Improved error handling for "Add Time Manual" * Adding @sapks 's changes, refactoring * Adding API for feature tracking * Adding unit test * Adding DISABLE/ENABLE option to Repository settings page * Improving translations * Applying @sapk 's changes * Removing repo_unit and using IssuesSetting for disabling/enabling timetracker * Adding DEFAULT_ENABLE_TIMETRACKER to config, installation and admin menu * Improving documentation * Fixing vendor/ folder * Changing timtracking routes by adding subgroups /times and /times/stopwatch (Proposed by @lafriks ) * Restricting write access to timetracking based on the repo settings (Proposed by @lafriks ) * Fixed minor permissions bug. * Adding CanUseTimetracker and IsTimetrackerEnabled in ctx.Repo * Allow assignees and authors to track there time too. * Fixed some build-time-errors + logical errors. * Removing unused Get...ByID functions * Moving IsTimetrackerEnabled from context.Repository to models.Repository * Adding a seperate file for issue related repo functions * Adding license headers * Fixed GetUserByParams return 404 * Moving /users/:username/times to /repos/:username/:reponame/times/:username for security reasons * Adding /repos/:username/times to get all tracked times of the repo * Updating sdk-dependency * Updating swagger.v1.json * Adding warning if user has already a running stopwatch (auto-timetracker) * Replacing GetTrackedTimesBy... with GetTrackedTimes(options FindTrackedTimesOptions) * Changing code.gitea.io/sdk back to code.gitea.io/sdk * Correcting spelling mistake * Updating vendor.json * Changing GET stopwatch/toggle to POST stopwatch/toggle * Changing GET stopwatch/cancel to POST stopwatch/cancel * Added migration for stopwatches/timetracking * Fixed some access bugs for read-only users * Added default allow only contributors to track time value to config * Fixed migration by chaging x.Iterate to x.Find * Resorted imports * Moved Add Time Manually form to repo_form.go * Removed "Seconds" field from Add Time Manually * Resorted imports * Improved permission checking * Fixed some bugs * Added integration test * gofmt * Adding integration test by @lafriks * Added created_unix to comment fixtures * Using last event instead of a fixed event * Adding another integration test by @lafriks * Fixing bug Timetracker enabled causing error 500 at sidebar.tpl * Fixed a refactoring bug that resulted in hiding "HasUserStopwatch" warning. * Returning TrackedTime instead of AddTimeOption at AddTime. * Updating SDK from go-gitea/go-sdk#69 * Resetting Go-SDK back to default repository * Fixing test-vendor by changing ini back to original repository * Adding "tags" to swagger spec * govendor sync * Removed duplicate * Formatting templates * Adding IsTimetrackingEnabled checks to API * Improving translations / english texts * Improving documentation * Updating swagger spec * Fixing integration test caused be translation-changes * Removed encoding issues in local_en-US.ini. * "Added" copyright line * Moved unit.IssuesConfig().EnableTimetracker into a != nil check * Removed some other encoding issues in local_en-US.ini * Improved javascript by checking if data-context exists * Replaced manual comment creation with CreateComment * Removed unnecessary code * Improved error checking * Small cosmetic changes * Replaced int>string>duration parsing with int>duration parsing * Fixed encoding issues * Removed unused imports Signed-off-by: Jonas Franz <info@jonasfranz.software>
7 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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208
  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. // ErrSSHDisabled represents an "SSH disabled" error.
  32. type ErrSSHDisabled struct {
  33. }
  34. // IsErrSSHDisabled checks if an error is a ErrSSHDisabled.
  35. func IsErrSSHDisabled(err error) bool {
  36. _, ok := err.(ErrSSHDisabled)
  37. return ok
  38. }
  39. func (err ErrSSHDisabled) Error() string {
  40. return "SSH is disabled"
  41. }
  42. // ____ ___
  43. // | | \______ ___________
  44. // | | / ___// __ \_ __ \
  45. // | | /\___ \\ ___/| | \/
  46. // |______//____ >\___ >__|
  47. // \/ \/
  48. // ErrUserAlreadyExist represents a "user already exists" error.
  49. type ErrUserAlreadyExist struct {
  50. Name string
  51. }
  52. // IsErrUserAlreadyExist checks if an error is a ErrUserAlreadyExists.
  53. func IsErrUserAlreadyExist(err error) bool {
  54. _, ok := err.(ErrUserAlreadyExist)
  55. return ok
  56. }
  57. func (err ErrUserAlreadyExist) Error() string {
  58. return fmt.Sprintf("user already exists [name: %s]", err.Name)
  59. }
  60. // ErrUserNotExist represents a "UserNotExist" kind of error.
  61. type ErrUserNotExist struct {
  62. UID int64
  63. Name string
  64. KeyID int64
  65. }
  66. // IsErrUserNotExist checks if an error is a ErrUserNotExist.
  67. func IsErrUserNotExist(err error) bool {
  68. _, ok := err.(ErrUserNotExist)
  69. return ok
  70. }
  71. func (err ErrUserNotExist) Error() string {
  72. return fmt.Sprintf("user does not exist [uid: %d, name: %s, keyid: %d]", err.UID, err.Name, err.KeyID)
  73. }
  74. // ErrEmailAlreadyUsed represents a "EmailAlreadyUsed" kind of error.
  75. type ErrEmailAlreadyUsed struct {
  76. Email string
  77. }
  78. // IsErrEmailAlreadyUsed checks if an error is a ErrEmailAlreadyUsed.
  79. func IsErrEmailAlreadyUsed(err error) bool {
  80. _, ok := err.(ErrEmailAlreadyUsed)
  81. return ok
  82. }
  83. func (err ErrEmailAlreadyUsed) Error() string {
  84. return fmt.Sprintf("e-mail has been used [email: %s]", err.Email)
  85. }
  86. // ErrOpenIDAlreadyUsed represents a "OpenIDAlreadyUsed" kind of error.
  87. type ErrOpenIDAlreadyUsed struct {
  88. OpenID string
  89. }
  90. // IsErrOpenIDAlreadyUsed checks if an error is a ErrOpenIDAlreadyUsed.
  91. func IsErrOpenIDAlreadyUsed(err error) bool {
  92. _, ok := err.(ErrOpenIDAlreadyUsed)
  93. return ok
  94. }
  95. func (err ErrOpenIDAlreadyUsed) Error() string {
  96. return fmt.Sprintf("OpenID has been used [oid: %s]", err.OpenID)
  97. }
  98. // ErrUserOwnRepos represents a "UserOwnRepos" kind of error.
  99. type ErrUserOwnRepos struct {
  100. UID int64
  101. }
  102. // IsErrUserOwnRepos checks if an error is a ErrUserOwnRepos.
  103. func IsErrUserOwnRepos(err error) bool {
  104. _, ok := err.(ErrUserOwnRepos)
  105. return ok
  106. }
  107. func (err ErrUserOwnRepos) Error() string {
  108. return fmt.Sprintf("user still has ownership of repositories [uid: %d]", err.UID)
  109. }
  110. // ErrUserHasOrgs represents a "UserHasOrgs" kind of error.
  111. type ErrUserHasOrgs struct {
  112. UID int64
  113. }
  114. // IsErrUserHasOrgs checks if an error is a ErrUserHasOrgs.
  115. func IsErrUserHasOrgs(err error) bool {
  116. _, ok := err.(ErrUserHasOrgs)
  117. return ok
  118. }
  119. func (err ErrUserHasOrgs) Error() string {
  120. return fmt.Sprintf("user still has membership of organizations [uid: %d]", err.UID)
  121. }
  122. // ErrUserNotAllowedCreateOrg represents a "UserNotAllowedCreateOrg" kind of error.
  123. type ErrUserNotAllowedCreateOrg struct {
  124. }
  125. // IsErrUserNotAllowedCreateOrg checks if an error is an ErrUserNotAllowedCreateOrg.
  126. func IsErrUserNotAllowedCreateOrg(err error) bool {
  127. _, ok := err.(ErrUserNotAllowedCreateOrg)
  128. return ok
  129. }
  130. func (err ErrUserNotAllowedCreateOrg) Error() string {
  131. return fmt.Sprintf("user is not allowed to create organizations")
  132. }
  133. // ErrReachLimitOfRepo represents a "ReachLimitOfRepo" kind of error.
  134. type ErrReachLimitOfRepo struct {
  135. Limit int
  136. }
  137. // IsErrReachLimitOfRepo checks if an error is a ErrReachLimitOfRepo.
  138. func IsErrReachLimitOfRepo(err error) bool {
  139. _, ok := err.(ErrReachLimitOfRepo)
  140. return ok
  141. }
  142. func (err ErrReachLimitOfRepo) Error() string {
  143. return fmt.Sprintf("user has reached maximum limit of repositories [limit: %d]", err.Limit)
  144. }
  145. // __ __.__ __ .__
  146. // / \ / \__| | _|__|
  147. // \ \/\/ / | |/ / |
  148. // \ /| | <| |
  149. // \__/\ / |__|__|_ \__|
  150. // \/ \/
  151. // ErrWikiAlreadyExist represents a "WikiAlreadyExist" kind of error.
  152. type ErrWikiAlreadyExist struct {
  153. Title string
  154. }
  155. // IsErrWikiAlreadyExist checks if an error is an ErrWikiAlreadyExist.
  156. func IsErrWikiAlreadyExist(err error) bool {
  157. _, ok := err.(ErrWikiAlreadyExist)
  158. return ok
  159. }
  160. func (err ErrWikiAlreadyExist) Error() string {
  161. return fmt.Sprintf("wiki page already exists [title: %s]", err.Title)
  162. }
  163. // ErrWikiReservedName represents a reserved name error.
  164. type ErrWikiReservedName struct {
  165. Title string
  166. }
  167. // IsErrWikiReservedName checks if an error is an ErrWikiReservedName.
  168. func IsErrWikiReservedName(err error) bool {
  169. _, ok := err.(ErrWikiReservedName)
  170. return ok
  171. }
  172. func (err ErrWikiReservedName) Error() string {
  173. return fmt.Sprintf("wiki title is reserved: %s", err.Title)
  174. }
  175. // ErrWikiInvalidFileName represents an invalid wiki file name.
  176. type ErrWikiInvalidFileName struct {
  177. FileName string
  178. }
  179. // IsErrWikiInvalidFileName checks if an error is an ErrWikiInvalidFileName.
  180. func IsErrWikiInvalidFileName(err error) bool {
  181. _, ok := err.(ErrWikiInvalidFileName)
  182. return ok
  183. }
  184. func (err ErrWikiInvalidFileName) Error() string {
  185. return fmt.Sprintf("Invalid wiki filename: %s", err.FileName)
  186. }
  187. // __________ ___. .__ .__ ____ __.
  188. // \______ \__ _\_ |__ | | |__| ____ | |/ _|____ ___.__.
  189. // | ___/ | \ __ \| | | |/ ___\ | <_/ __ < | |
  190. // | | | | / \_\ \ |_| \ \___ | | \ ___/\___ |
  191. // |____| |____/|___ /____/__|\___ > |____|__ \___ > ____|
  192. // \/ \/ \/ \/\/
  193. // ErrKeyUnableVerify represents a "KeyUnableVerify" kind of error.
  194. type ErrKeyUnableVerify struct {
  195. Result string
  196. }
  197. // IsErrKeyUnableVerify checks if an error is a ErrKeyUnableVerify.
  198. func IsErrKeyUnableVerify(err error) bool {
  199. _, ok := err.(ErrKeyUnableVerify)
  200. return ok
  201. }
  202. func (err ErrKeyUnableVerify) Error() string {
  203. return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
  204. }
  205. // ErrKeyNotExist represents a "KeyNotExist" kind of error.
  206. type ErrKeyNotExist struct {
  207. ID int64
  208. }
  209. // IsErrKeyNotExist checks if an error is a ErrKeyNotExist.
  210. func IsErrKeyNotExist(err error) bool {
  211. _, ok := err.(ErrKeyNotExist)
  212. return ok
  213. }
  214. func (err ErrKeyNotExist) Error() string {
  215. return fmt.Sprintf("public key does not exist [id: %d]", err.ID)
  216. }
  217. // ErrKeyAlreadyExist represents a "KeyAlreadyExist" kind of error.
  218. type ErrKeyAlreadyExist struct {
  219. OwnerID int64
  220. Fingerprint string
  221. Content string
  222. }
  223. // IsErrKeyAlreadyExist checks if an error is a ErrKeyAlreadyExist.
  224. func IsErrKeyAlreadyExist(err error) bool {
  225. _, ok := err.(ErrKeyAlreadyExist)
  226. return ok
  227. }
  228. func (err ErrKeyAlreadyExist) Error() string {
  229. return fmt.Sprintf("public key already exists [owner_id: %d, finter_print: %s, content: %s]",
  230. err.OwnerID, err.Fingerprint, err.Content)
  231. }
  232. // ErrKeyNameAlreadyUsed represents a "KeyNameAlreadyUsed" kind of error.
  233. type ErrKeyNameAlreadyUsed struct {
  234. OwnerID int64
  235. Name string
  236. }
  237. // IsErrKeyNameAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  238. func IsErrKeyNameAlreadyUsed(err error) bool {
  239. _, ok := err.(ErrKeyNameAlreadyUsed)
  240. return ok
  241. }
  242. func (err ErrKeyNameAlreadyUsed) Error() string {
  243. return fmt.Sprintf("public key already exists [owner_id: %d, name: %s]", err.OwnerID, err.Name)
  244. }
  245. // ErrGPGNoEmailFound represents a "ErrGPGNoEmailFound" kind of error.
  246. type ErrGPGNoEmailFound struct {
  247. FailedEmails []string
  248. }
  249. // IsErrGPGNoEmailFound checks if an error is a ErrGPGNoEmailFound.
  250. func IsErrGPGNoEmailFound(err error) bool {
  251. _, ok := err.(ErrGPGNoEmailFound)
  252. return ok
  253. }
  254. func (err ErrGPGNoEmailFound) Error() string {
  255. return fmt.Sprintf("none of the emails attached to the GPG key could be found: %v", err.FailedEmails)
  256. }
  257. // ErrGPGKeyParsing represents a "ErrGPGKeyParsing" kind of error.
  258. type ErrGPGKeyParsing struct {
  259. ParseError error
  260. }
  261. // IsErrGPGKeyParsing checks if an error is a ErrGPGKeyParsing.
  262. func IsErrGPGKeyParsing(err error) bool {
  263. _, ok := err.(ErrGPGKeyParsing)
  264. return ok
  265. }
  266. func (err ErrGPGKeyParsing) Error() string {
  267. return fmt.Sprintf("failed to parse gpg key %s", err.ParseError.Error())
  268. }
  269. // ErrGPGKeyNotExist represents a "GPGKeyNotExist" kind of error.
  270. type ErrGPGKeyNotExist struct {
  271. ID int64
  272. }
  273. // IsErrGPGKeyNotExist checks if an error is a ErrGPGKeyNotExist.
  274. func IsErrGPGKeyNotExist(err error) bool {
  275. _, ok := err.(ErrGPGKeyNotExist)
  276. return ok
  277. }
  278. func (err ErrGPGKeyNotExist) Error() string {
  279. return fmt.Sprintf("public gpg key does not exist [id: %d]", err.ID)
  280. }
  281. // ErrGPGKeyIDAlreadyUsed represents a "GPGKeyIDAlreadyUsed" kind of error.
  282. type ErrGPGKeyIDAlreadyUsed struct {
  283. KeyID string
  284. }
  285. // IsErrGPGKeyIDAlreadyUsed checks if an error is a ErrKeyNameAlreadyUsed.
  286. func IsErrGPGKeyIDAlreadyUsed(err error) bool {
  287. _, ok := err.(ErrGPGKeyIDAlreadyUsed)
  288. return ok
  289. }
  290. func (err ErrGPGKeyIDAlreadyUsed) Error() string {
  291. return fmt.Sprintf("public key already exists [key_id: %s]", err.KeyID)
  292. }
  293. // ErrGPGKeyAccessDenied represents a "GPGKeyAccessDenied" kind of Error.
  294. type ErrGPGKeyAccessDenied struct {
  295. UserID int64
  296. KeyID int64
  297. }
  298. // IsErrGPGKeyAccessDenied checks if an error is a ErrGPGKeyAccessDenied.
  299. func IsErrGPGKeyAccessDenied(err error) bool {
  300. _, ok := err.(ErrGPGKeyAccessDenied)
  301. return ok
  302. }
  303. // Error pretty-prints an error of type ErrGPGKeyAccessDenied.
  304. func (err ErrGPGKeyAccessDenied) Error() string {
  305. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d]",
  306. err.UserID, err.KeyID)
  307. }
  308. // ErrKeyAccessDenied represents a "KeyAccessDenied" kind of error.
  309. type ErrKeyAccessDenied struct {
  310. UserID int64
  311. KeyID int64
  312. Note string
  313. }
  314. // IsErrKeyAccessDenied checks if an error is a ErrKeyAccessDenied.
  315. func IsErrKeyAccessDenied(err error) bool {
  316. _, ok := err.(ErrKeyAccessDenied)
  317. return ok
  318. }
  319. func (err ErrKeyAccessDenied) Error() string {
  320. return fmt.Sprintf("user does not have access to the key [user_id: %d, key_id: %d, note: %s]",
  321. err.UserID, err.KeyID, err.Note)
  322. }
  323. // ErrDeployKeyNotExist represents a "DeployKeyNotExist" kind of error.
  324. type ErrDeployKeyNotExist struct {
  325. ID int64
  326. KeyID int64
  327. RepoID int64
  328. }
  329. // IsErrDeployKeyNotExist checks if an error is a ErrDeployKeyNotExist.
  330. func IsErrDeployKeyNotExist(err error) bool {
  331. _, ok := err.(ErrDeployKeyNotExist)
  332. return ok
  333. }
  334. func (err ErrDeployKeyNotExist) Error() string {
  335. return fmt.Sprintf("Deploy key does not exist [id: %d, key_id: %d, repo_id: %d]", err.ID, err.KeyID, err.RepoID)
  336. }
  337. // ErrDeployKeyAlreadyExist represents a "DeployKeyAlreadyExist" kind of error.
  338. type ErrDeployKeyAlreadyExist struct {
  339. KeyID int64
  340. RepoID int64
  341. }
  342. // IsErrDeployKeyAlreadyExist checks if an error is a ErrDeployKeyAlreadyExist.
  343. func IsErrDeployKeyAlreadyExist(err error) bool {
  344. _, ok := err.(ErrDeployKeyAlreadyExist)
  345. return ok
  346. }
  347. func (err ErrDeployKeyAlreadyExist) Error() string {
  348. return fmt.Sprintf("public key already exists [key_id: %d, repo_id: %d]", err.KeyID, err.RepoID)
  349. }
  350. // ErrDeployKeyNameAlreadyUsed represents a "DeployKeyNameAlreadyUsed" kind of error.
  351. type ErrDeployKeyNameAlreadyUsed struct {
  352. RepoID int64
  353. Name string
  354. }
  355. // IsErrDeployKeyNameAlreadyUsed checks if an error is a ErrDeployKeyNameAlreadyUsed.
  356. func IsErrDeployKeyNameAlreadyUsed(err error) bool {
  357. _, ok := err.(ErrDeployKeyNameAlreadyUsed)
  358. return ok
  359. }
  360. func (err ErrDeployKeyNameAlreadyUsed) Error() string {
  361. return fmt.Sprintf("public key already exists [repo_id: %d, name: %s]", err.RepoID, err.Name)
  362. }
  363. // _____ ___________ __
  364. // / _ \ ____ ____ ____ ______ _____\__ ___/___ | | __ ____ ____
  365. // / /_\ \_/ ___\/ ___\/ __ \ / ___// ___/ | | / _ \| |/ // __ \ / \
  366. // / | \ \__\ \__\ ___/ \___ \ \___ \ | |( <_> ) <\ ___/| | \
  367. // \____|__ /\___ >___ >___ >____ >____ > |____| \____/|__|_ \\___ >___| /
  368. // \/ \/ \/ \/ \/ \/ \/ \/ \/
  369. // ErrAccessTokenNotExist represents a "AccessTokenNotExist" kind of error.
  370. type ErrAccessTokenNotExist struct {
  371. SHA string
  372. }
  373. // IsErrAccessTokenNotExist checks if an error is a ErrAccessTokenNotExist.
  374. func IsErrAccessTokenNotExist(err error) bool {
  375. _, ok := err.(ErrAccessTokenNotExist)
  376. return ok
  377. }
  378. func (err ErrAccessTokenNotExist) Error() string {
  379. return fmt.Sprintf("access token does not exist [sha: %s]", err.SHA)
  380. }
  381. // ErrAccessTokenEmpty represents a "AccessTokenEmpty" kind of error.
  382. type ErrAccessTokenEmpty struct {
  383. }
  384. // IsErrAccessTokenEmpty checks if an error is a ErrAccessTokenEmpty.
  385. func IsErrAccessTokenEmpty(err error) bool {
  386. _, ok := err.(ErrAccessTokenEmpty)
  387. return ok
  388. }
  389. func (err ErrAccessTokenEmpty) Error() string {
  390. return fmt.Sprintf("access token is empty")
  391. }
  392. // ________ .__ __ .__
  393. // \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____
  394. // / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \
  395. // / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \
  396. // \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| /
  397. // \/ /_____/ \/ \/ \/ \/ \/
  398. // ErrOrgNotExist represents a "OrgNotExist" kind of error.
  399. type ErrOrgNotExist struct {
  400. ID int64
  401. Name string
  402. }
  403. // IsErrOrgNotExist checks if an error is a ErrOrgNotExist.
  404. func IsErrOrgNotExist(err error) bool {
  405. _, ok := err.(ErrOrgNotExist)
  406. return ok
  407. }
  408. func (err ErrOrgNotExist) Error() string {
  409. return fmt.Sprintf("org does not exist [id: %d, name: %s]", err.ID, err.Name)
  410. }
  411. // ErrLastOrgOwner represents a "LastOrgOwner" kind of error.
  412. type ErrLastOrgOwner struct {
  413. UID int64
  414. }
  415. // IsErrLastOrgOwner checks if an error is a ErrLastOrgOwner.
  416. func IsErrLastOrgOwner(err error) bool {
  417. _, ok := err.(ErrLastOrgOwner)
  418. return ok
  419. }
  420. func (err ErrLastOrgOwner) Error() string {
  421. return fmt.Sprintf("user is the last member of owner team [uid: %d]", err.UID)
  422. }
  423. //.____ ____________________
  424. //| | \_ _____/ _____/
  425. //| | | __) \_____ \
  426. //| |___| \ / \
  427. //|_______ \___ / /_______ /
  428. // \/ \/ \/
  429. // ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.
  430. type ErrLFSLockNotExist struct {
  431. ID int64
  432. RepoID int64
  433. Path string
  434. }
  435. // IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.
  436. func IsErrLFSLockNotExist(err error) bool {
  437. _, ok := err.(ErrLFSLockNotExist)
  438. return ok
  439. }
  440. func (err ErrLFSLockNotExist) Error() string {
  441. return fmt.Sprintf("lfs lock does not exist [id: %d, rid: %d, path: %s]", err.ID, err.RepoID, err.Path)
  442. }
  443. // ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.
  444. type ErrLFSUnauthorizedAction struct {
  445. RepoID int64
  446. UserName string
  447. Mode AccessMode
  448. }
  449. // IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
  450. func IsErrLFSUnauthorizedAction(err error) bool {
  451. _, ok := err.(ErrLFSUnauthorizedAction)
  452. return ok
  453. }
  454. func (err ErrLFSUnauthorizedAction) Error() string {
  455. if err.Mode == AccessModeWrite {
  456. return fmt.Sprintf("User %s doesn't have write access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  457. }
  458. return fmt.Sprintf("User %s doesn't have read access for lfs lock [rid: %d]", err.UserName, err.RepoID)
  459. }
  460. // ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.
  461. type ErrLFSLockAlreadyExist struct {
  462. RepoID int64
  463. Path string
  464. }
  465. // IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.
  466. func IsErrLFSLockAlreadyExist(err error) bool {
  467. _, ok := err.(ErrLFSLockAlreadyExist)
  468. return ok
  469. }
  470. func (err ErrLFSLockAlreadyExist) Error() string {
  471. return fmt.Sprintf("lfs lock already exists [rid: %d, path: %s]", err.RepoID, err.Path)
  472. }
  473. // __________ .__ __
  474. // \______ \ ____ ______ ____ _____|__|/ |_ ___________ ___.__.
  475. // | _// __ \\____ \ / _ \/ ___/ \ __\/ _ \_ __ < | |
  476. // | | \ ___/| |_> > <_> )___ \| || | ( <_> ) | \/\___ |
  477. // |____|_ /\___ > __/ \____/____ >__||__| \____/|__| / ____|
  478. // \/ \/|__| \/ \/
  479. // ErrRepoNotExist represents a "RepoNotExist" kind of error.
  480. type ErrRepoNotExist struct {
  481. ID int64
  482. UID int64
  483. OwnerName string
  484. Name string
  485. }
  486. // IsErrRepoNotExist checks if an error is a ErrRepoNotExist.
  487. func IsErrRepoNotExist(err error) bool {
  488. _, ok := err.(ErrRepoNotExist)
  489. return ok
  490. }
  491. func (err ErrRepoNotExist) Error() string {
  492. return fmt.Sprintf("repository does not exist [id: %d, uid: %d, owner_name: %s, name: %s]",
  493. err.ID, err.UID, err.OwnerName, err.Name)
  494. }
  495. // ErrRepoAlreadyExist represents a "RepoAlreadyExist" kind of error.
  496. type ErrRepoAlreadyExist struct {
  497. Uname string
  498. Name string
  499. }
  500. // IsErrRepoAlreadyExist checks if an error is a ErrRepoAlreadyExist.
  501. func IsErrRepoAlreadyExist(err error) bool {
  502. _, ok := err.(ErrRepoAlreadyExist)
  503. return ok
  504. }
  505. func (err ErrRepoAlreadyExist) Error() string {
  506. return fmt.Sprintf("repository already exists [uname: %s, name: %s]", err.Uname, err.Name)
  507. }
  508. // ErrRepoRedirectNotExist represents a "RepoRedirectNotExist" kind of error.
  509. type ErrRepoRedirectNotExist struct {
  510. OwnerID int64
  511. RepoName string
  512. }
  513. // IsErrRepoRedirectNotExist check if an error is an ErrRepoRedirectNotExist
  514. func IsErrRepoRedirectNotExist(err error) bool {
  515. _, ok := err.(ErrRepoRedirectNotExist)
  516. return ok
  517. }
  518. func (err ErrRepoRedirectNotExist) Error() string {
  519. return fmt.Sprintf("repository redirect does not exist [uid: %d, name: %s]", err.OwnerID, err.RepoName)
  520. }
  521. // ErrInvalidCloneAddr represents a "InvalidCloneAddr" kind of error.
  522. type ErrInvalidCloneAddr struct {
  523. IsURLError bool
  524. IsInvalidPath bool
  525. IsPermissionDenied bool
  526. }
  527. // IsErrInvalidCloneAddr checks if an error is a ErrInvalidCloneAddr.
  528. func IsErrInvalidCloneAddr(err error) bool {
  529. _, ok := err.(ErrInvalidCloneAddr)
  530. return ok
  531. }
  532. func (err ErrInvalidCloneAddr) Error() string {
  533. return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
  534. err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
  535. }
  536. // ErrUpdateTaskNotExist represents a "UpdateTaskNotExist" kind of error.
  537. type ErrUpdateTaskNotExist struct {
  538. UUID string
  539. }
  540. // IsErrUpdateTaskNotExist checks if an error is a ErrUpdateTaskNotExist.
  541. func IsErrUpdateTaskNotExist(err error) bool {
  542. _, ok := err.(ErrUpdateTaskNotExist)
  543. return ok
  544. }
  545. func (err ErrUpdateTaskNotExist) Error() string {
  546. return fmt.Sprintf("update task does not exist [uuid: %s]", err.UUID)
  547. }
  548. // ErrReleaseAlreadyExist represents a "ReleaseAlreadyExist" kind of error.
  549. type ErrReleaseAlreadyExist struct {
  550. TagName string
  551. }
  552. // IsErrReleaseAlreadyExist checks if an error is a ErrReleaseAlreadyExist.
  553. func IsErrReleaseAlreadyExist(err error) bool {
  554. _, ok := err.(ErrReleaseAlreadyExist)
  555. return ok
  556. }
  557. func (err ErrReleaseAlreadyExist) Error() string {
  558. return fmt.Sprintf("release tag already exist [tag_name: %s]", err.TagName)
  559. }
  560. // ErrReleaseNotExist represents a "ReleaseNotExist" kind of error.
  561. type ErrReleaseNotExist struct {
  562. ID int64
  563. TagName string
  564. }
  565. // IsErrReleaseNotExist checks if an error is a ErrReleaseNotExist.
  566. func IsErrReleaseNotExist(err error) bool {
  567. _, ok := err.(ErrReleaseNotExist)
  568. return ok
  569. }
  570. func (err ErrReleaseNotExist) Error() string {
  571. return fmt.Sprintf("release tag does not exist [id: %d, tag_name: %s]", err.ID, err.TagName)
  572. }
  573. // ErrInvalidTagName represents a "InvalidTagName" kind of error.
  574. type ErrInvalidTagName struct {
  575. TagName string
  576. }
  577. // IsErrInvalidTagName checks if an error is a ErrInvalidTagName.
  578. func IsErrInvalidTagName(err error) bool {
  579. _, ok := err.(ErrInvalidTagName)
  580. return ok
  581. }
  582. func (err ErrInvalidTagName) Error() string {
  583. return fmt.Sprintf("release tag name is not valid [tag_name: %s]", err.TagName)
  584. }
  585. // ErrRepoFileAlreadyExist represents a "RepoFileAlreadyExist" kind of error.
  586. type ErrRepoFileAlreadyExist struct {
  587. FileName string
  588. }
  589. // IsErrRepoFileAlreadyExist checks if an error is a ErrRepoFileAlreadyExist.
  590. func IsErrRepoFileAlreadyExist(err error) bool {
  591. _, ok := err.(ErrRepoFileAlreadyExist)
  592. return ok
  593. }
  594. func (err ErrRepoFileAlreadyExist) Error() string {
  595. return fmt.Sprintf("repository file already exists [file_name: %s]", err.FileName)
  596. }
  597. // __________ .__
  598. // \______ \____________ ____ ____ | |__
  599. // | | _/\_ __ \__ \ / \_/ ___\| | \
  600. // | | \ | | \// __ \| | \ \___| Y \
  601. // |______ / |__| (____ /___| /\___ >___| /
  602. // \/ \/ \/ \/ \/
  603. // ErrBranchNotExist represents a "BranchNotExist" kind of error.
  604. type ErrBranchNotExist struct {
  605. Name string
  606. }
  607. // IsErrBranchNotExist checks if an error is a ErrBranchNotExist.
  608. func IsErrBranchNotExist(err error) bool {
  609. _, ok := err.(ErrBranchNotExist)
  610. return ok
  611. }
  612. func (err ErrBranchNotExist) Error() string {
  613. return fmt.Sprintf("branch does not exist [name: %s]", err.Name)
  614. }
  615. // ErrBranchAlreadyExists represents an error that branch with such name already exists
  616. type ErrBranchAlreadyExists struct {
  617. BranchName string
  618. }
  619. // IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
  620. func IsErrBranchAlreadyExists(err error) bool {
  621. _, ok := err.(ErrBranchAlreadyExists)
  622. return ok
  623. }
  624. func (err ErrBranchAlreadyExists) Error() string {
  625. return fmt.Sprintf("branch already exists [name: %s]", err.BranchName)
  626. }
  627. // ErrBranchNameConflict represents an error that branch name conflicts with other branch
  628. type ErrBranchNameConflict struct {
  629. BranchName string
  630. }
  631. // IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
  632. func IsErrBranchNameConflict(err error) bool {
  633. _, ok := err.(ErrBranchNameConflict)
  634. return ok
  635. }
  636. func (err ErrBranchNameConflict) Error() string {
  637. return fmt.Sprintf("branch conflicts with existing branch [name: %s]", err.BranchName)
  638. }
  639. // ErrTagAlreadyExists represents an error that tag with such name already exists
  640. type ErrTagAlreadyExists struct {
  641. TagName string
  642. }
  643. // IsErrTagAlreadyExists checks if an error is an ErrTagAlreadyExists.
  644. func IsErrTagAlreadyExists(err error) bool {
  645. _, ok := err.(ErrTagAlreadyExists)
  646. return ok
  647. }
  648. func (err ErrTagAlreadyExists) Error() string {
  649. return fmt.Sprintf("tag already exists [name: %s]", err.TagName)
  650. }
  651. // __ __ ___. .__ __
  652. // / \ / \ ____\_ |__ | |__ ____ ____ | | __
  653. // \ \/\/ // __ \| __ \| | \ / _ \ / _ \| |/ /
  654. // \ /\ ___/| \_\ \ Y ( <_> | <_> ) <
  655. // \__/\ / \___ >___ /___| /\____/ \____/|__|_ \
  656. // \/ \/ \/ \/ \/
  657. // ErrWebhookNotExist represents a "WebhookNotExist" kind of error.
  658. type ErrWebhookNotExist struct {
  659. ID int64
  660. }
  661. // IsErrWebhookNotExist checks if an error is a ErrWebhookNotExist.
  662. func IsErrWebhookNotExist(err error) bool {
  663. _, ok := err.(ErrWebhookNotExist)
  664. return ok
  665. }
  666. func (err ErrWebhookNotExist) Error() string {
  667. return fmt.Sprintf("webhook does not exist [id: %d]", err.ID)
  668. }
  669. // .___
  670. // | | ______ ________ __ ____
  671. // | |/ ___// ___/ | \_/ __ \
  672. // | |\___ \ \___ \| | /\ ___/
  673. // |___/____ >____ >____/ \___ >
  674. // \/ \/ \/
  675. // ErrIssueNotExist represents a "IssueNotExist" kind of error.
  676. type ErrIssueNotExist struct {
  677. ID int64
  678. RepoID int64
  679. Index int64
  680. }
  681. // IsErrIssueNotExist checks if an error is a ErrIssueNotExist.
  682. func IsErrIssueNotExist(err error) bool {
  683. _, ok := err.(ErrIssueNotExist)
  684. return ok
  685. }
  686. func (err ErrIssueNotExist) Error() string {
  687. return fmt.Sprintf("issue does not exist [id: %d, repo_id: %d, index: %d]", err.ID, err.RepoID, err.Index)
  688. }
  689. // __________ .__ .__ __________ __
  690. // \______ \__ __| | | |\______ \ ____ ________ __ ____ _______/ |_
  691. // | ___/ | \ | | | | _// __ \/ ____/ | \_/ __ \ / ___/\ __\
  692. // | | | | / |_| |_| | \ ___< <_| | | /\ ___/ \___ \ | |
  693. // |____| |____/|____/____/____|_ /\___ >__ |____/ \___ >____ > |__|
  694. // \/ \/ |__| \/ \/
  695. // ErrPullRequestNotExist represents a "PullRequestNotExist" kind of error.
  696. type ErrPullRequestNotExist struct {
  697. ID int64
  698. IssueID int64
  699. HeadRepoID int64
  700. BaseRepoID int64
  701. HeadBranch string
  702. BaseBranch string
  703. }
  704. // IsErrPullRequestNotExist checks if an error is a ErrPullRequestNotExist.
  705. func IsErrPullRequestNotExist(err error) bool {
  706. _, ok := err.(ErrPullRequestNotExist)
  707. return ok
  708. }
  709. func (err ErrPullRequestNotExist) Error() string {
  710. 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]",
  711. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  712. }
  713. // ErrPullRequestAlreadyExists represents a "PullRequestAlreadyExists"-error
  714. type ErrPullRequestAlreadyExists struct {
  715. ID int64
  716. IssueID int64
  717. HeadRepoID int64
  718. BaseRepoID int64
  719. HeadBranch string
  720. BaseBranch string
  721. }
  722. // IsErrPullRequestAlreadyExists checks if an error is a ErrPullRequestAlreadyExists.
  723. func IsErrPullRequestAlreadyExists(err error) bool {
  724. _, ok := err.(ErrPullRequestAlreadyExists)
  725. return ok
  726. }
  727. // Error does pretty-printing :D
  728. func (err ErrPullRequestAlreadyExists) Error() string {
  729. 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]",
  730. err.ID, err.IssueID, err.HeadRepoID, err.BaseRepoID, err.HeadBranch, err.BaseBranch)
  731. }
  732. // ErrInvalidMergeStyle represents an error if merging with disabled merge strategy
  733. type ErrInvalidMergeStyle struct {
  734. ID int64
  735. Style MergeStyle
  736. }
  737. // IsErrInvalidMergeStyle checks if an error is a ErrInvalidMergeStyle.
  738. func IsErrInvalidMergeStyle(err error) bool {
  739. _, ok := err.(ErrInvalidMergeStyle)
  740. return ok
  741. }
  742. func (err ErrInvalidMergeStyle) Error() string {
  743. return fmt.Sprintf("merge strategy is not allowed or is invalid [repo_id: %d, strategy: %s]",
  744. err.ID, err.Style)
  745. }
  746. // _________ __
  747. // \_ ___ \ ____ _____ _____ ____ _____/ |_
  748. // / \ \/ / _ \ / \ / \_/ __ \ / \ __\
  749. // \ \___( <_> ) Y Y \ Y Y \ ___/| | \ |
  750. // \______ /\____/|__|_| /__|_| /\___ >___| /__|
  751. // \/ \/ \/ \/ \/
  752. // ErrCommentNotExist represents a "CommentNotExist" kind of error.
  753. type ErrCommentNotExist struct {
  754. ID int64
  755. IssueID int64
  756. }
  757. // IsErrCommentNotExist checks if an error is a ErrCommentNotExist.
  758. func IsErrCommentNotExist(err error) bool {
  759. _, ok := err.(ErrCommentNotExist)
  760. return ok
  761. }
  762. func (err ErrCommentNotExist) Error() string {
  763. return fmt.Sprintf("comment does not exist [id: %d, issue_id: %d]", err.ID, err.IssueID)
  764. }
  765. // _________ __ __ .__
  766. // / _____// |_ ____ ________ _ _______ _/ |_ ____ | |__
  767. // \_____ \\ __\/ _ \\____ \ \/ \/ /\__ \\ __\/ ___\| | \
  768. // / \| | ( <_> ) |_> > / / __ \| | \ \___| Y \
  769. // /_______ /|__| \____/| __/ \/\_/ (____ /__| \___ >___| /
  770. // \/ |__| \/ \/ \/
  771. // ErrStopwatchNotExist represents a "Stopwatch Not Exist" kind of error.
  772. type ErrStopwatchNotExist struct {
  773. ID int64
  774. }
  775. // IsErrStopwatchNotExist checks if an error is a ErrStopwatchNotExist.
  776. func IsErrStopwatchNotExist(err error) bool {
  777. _, ok := err.(ErrStopwatchNotExist)
  778. return ok
  779. }
  780. func (err ErrStopwatchNotExist) Error() string {
  781. return fmt.Sprintf("stopwatch does not exist [id: %d]", err.ID)
  782. }
  783. // ___________ __ .______________.__
  784. // \__ ___/___________ ____ | | __ ____ __| _/\__ ___/|__| _____ ____
  785. // | | \_ __ \__ \ _/ ___\| |/ // __ \ / __ | | | | |/ \_/ __ \
  786. // | | | | \// __ \\ \___| <\ ___// /_/ | | | | | Y Y \ ___/
  787. // |____| |__| (____ /\___ >__|_ \\___ >____ | |____| |__|__|_| /\___ >
  788. // \/ \/ \/ \/ \/ \/ \/
  789. // ErrTrackedTimeNotExist represents a "TrackedTime Not Exist" kind of error.
  790. type ErrTrackedTimeNotExist struct {
  791. ID int64
  792. }
  793. // IsErrTrackedTimeNotExist checks if an error is a ErrTrackedTimeNotExist.
  794. func IsErrTrackedTimeNotExist(err error) bool {
  795. _, ok := err.(ErrTrackedTimeNotExist)
  796. return ok
  797. }
  798. func (err ErrTrackedTimeNotExist) Error() string {
  799. return fmt.Sprintf("tracked time does not exist [id: %d]", err.ID)
  800. }
  801. // .____ ___. .__
  802. // | | _____ \_ |__ ____ | |
  803. // | | \__ \ | __ \_/ __ \| |
  804. // | |___ / __ \| \_\ \ ___/| |__
  805. // |_______ (____ /___ /\___ >____/
  806. // \/ \/ \/ \/
  807. // ErrLabelNotExist represents a "LabelNotExist" kind of error.
  808. type ErrLabelNotExist struct {
  809. LabelID int64
  810. RepoID int64
  811. }
  812. // IsErrLabelNotExist checks if an error is a ErrLabelNotExist.
  813. func IsErrLabelNotExist(err error) bool {
  814. _, ok := err.(ErrLabelNotExist)
  815. return ok
  816. }
  817. func (err ErrLabelNotExist) Error() string {
  818. return fmt.Sprintf("label does not exist [label_id: %d, repo_id: %d]", err.LabelID, err.RepoID)
  819. }
  820. // _____ .__.__ __
  821. // / \ |__| | ____ _______/ |_ ____ ____ ____
  822. // / \ / \| | | _/ __ \ / ___/\ __\/ _ \ / \_/ __ \
  823. // / Y \ | |_\ ___/ \___ \ | | ( <_> ) | \ ___/
  824. // \____|__ /__|____/\___ >____ > |__| \____/|___| /\___ >
  825. // \/ \/ \/ \/ \/
  826. // ErrMilestoneNotExist represents a "MilestoneNotExist" kind of error.
  827. type ErrMilestoneNotExist struct {
  828. ID int64
  829. RepoID int64
  830. }
  831. // IsErrMilestoneNotExist checks if an error is a ErrMilestoneNotExist.
  832. func IsErrMilestoneNotExist(err error) bool {
  833. _, ok := err.(ErrMilestoneNotExist)
  834. return ok
  835. }
  836. func (err ErrMilestoneNotExist) Error() string {
  837. return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
  838. }
  839. // _____ __ __ .__ __
  840. // / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
  841. // / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
  842. // / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
  843. // \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
  844. // \/ \/ \/ \/ \/ \/ \/
  845. // ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
  846. type ErrAttachmentNotExist struct {
  847. ID int64
  848. UUID string
  849. }
  850. // IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
  851. func IsErrAttachmentNotExist(err error) bool {
  852. _, ok := err.(ErrAttachmentNotExist)
  853. return ok
  854. }
  855. func (err ErrAttachmentNotExist) Error() string {
  856. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  857. }
  858. // .____ .__ _________
  859. // | | ____ ____ |__| ____ / _____/ ____ __ _________ ____ ____
  860. // | | / _ \ / ___\| |/ \ \_____ \ / _ \| | \_ __ \_/ ___\/ __ \
  861. // | |__( <_> ) /_/ > | | \ / ( <_> ) | /| | \/\ \__\ ___/
  862. // |_______ \____/\___ /|__|___| / /_______ /\____/|____/ |__| \___ >___ >
  863. // \/ /_____/ \/ \/ \/ \/
  864. // ErrLoginSourceNotExist represents a "LoginSourceNotExist" kind of error.
  865. type ErrLoginSourceNotExist struct {
  866. ID int64
  867. }
  868. // IsErrLoginSourceNotExist checks if an error is a ErrLoginSourceNotExist.
  869. func IsErrLoginSourceNotExist(err error) bool {
  870. _, ok := err.(ErrLoginSourceNotExist)
  871. return ok
  872. }
  873. func (err ErrLoginSourceNotExist) Error() string {
  874. return fmt.Sprintf("login source does not exist [id: %d]", err.ID)
  875. }
  876. // ErrLoginSourceAlreadyExist represents a "LoginSourceAlreadyExist" kind of error.
  877. type ErrLoginSourceAlreadyExist struct {
  878. Name string
  879. }
  880. // IsErrLoginSourceAlreadyExist checks if an error is a ErrLoginSourceAlreadyExist.
  881. func IsErrLoginSourceAlreadyExist(err error) bool {
  882. _, ok := err.(ErrLoginSourceAlreadyExist)
  883. return ok
  884. }
  885. func (err ErrLoginSourceAlreadyExist) Error() string {
  886. return fmt.Sprintf("login source already exists [name: %s]", err.Name)
  887. }
  888. // ErrLoginSourceInUse represents a "LoginSourceInUse" kind of error.
  889. type ErrLoginSourceInUse struct {
  890. ID int64
  891. }
  892. // IsErrLoginSourceInUse checks if an error is a ErrLoginSourceInUse.
  893. func IsErrLoginSourceInUse(err error) bool {
  894. _, ok := err.(ErrLoginSourceInUse)
  895. return ok
  896. }
  897. func (err ErrLoginSourceInUse) Error() string {
  898. return fmt.Sprintf("login source is still used by some users [id: %d]", err.ID)
  899. }
  900. // ___________
  901. // \__ ___/___ _____ _____
  902. // | |_/ __ \\__ \ / \
  903. // | |\ ___/ / __ \| Y Y \
  904. // |____| \___ >____ /__|_| /
  905. // \/ \/ \/
  906. // ErrTeamAlreadyExist represents a "TeamAlreadyExist" kind of error.
  907. type ErrTeamAlreadyExist struct {
  908. OrgID int64
  909. Name string
  910. }
  911. // IsErrTeamAlreadyExist checks if an error is a ErrTeamAlreadyExist.
  912. func IsErrTeamAlreadyExist(err error) bool {
  913. _, ok := err.(ErrTeamAlreadyExist)
  914. return ok
  915. }
  916. func (err ErrTeamAlreadyExist) Error() string {
  917. return fmt.Sprintf("team already exists [org_id: %d, name: %s]", err.OrgID, err.Name)
  918. }
  919. //
  920. // Two-factor authentication
  921. //
  922. // ErrTwoFactorNotEnrolled indicates that a user is not enrolled in two-factor authentication.
  923. type ErrTwoFactorNotEnrolled struct {
  924. UID int64
  925. }
  926. // IsErrTwoFactorNotEnrolled checks if an error is a ErrTwoFactorNotEnrolled.
  927. func IsErrTwoFactorNotEnrolled(err error) bool {
  928. _, ok := err.(ErrTwoFactorNotEnrolled)
  929. return ok
  930. }
  931. func (err ErrTwoFactorNotEnrolled) Error() string {
  932. return fmt.Sprintf("user not enrolled in 2FA [uid: %d]", err.UID)
  933. }
  934. // ____ ___ .__ .___
  935. // | | \______ | | _________ __| _/
  936. // | | /\____ \| | / _ \__ \ / __ |
  937. // | | / | |_> > |_( <_> ) __ \_/ /_/ |
  938. // |______/ | __/|____/\____(____ /\____ |
  939. // |__| \/ \/
  940. //
  941. // ErrUploadNotExist represents a "UploadNotExist" kind of error.
  942. type ErrUploadNotExist struct {
  943. ID int64
  944. UUID string
  945. }
  946. // IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
  947. func IsErrUploadNotExist(err error) bool {
  948. _, ok := err.(ErrAttachmentNotExist)
  949. return ok
  950. }
  951. func (err ErrUploadNotExist) Error() string {
  952. return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
  953. }
  954. // ___________ __ .__ .____ .__ ____ ___
  955. // \_ _____/__ ____/ |_ ___________ ____ _____ | | | | ____ ____ |__| ____ | | \______ ___________
  956. // | __)_\ \/ /\ __\/ __ \_ __ \/ \\__ \ | | | | / _ \ / ___\| |/ \ | | / ___// __ \_ __ \
  957. // | \> < | | \ ___/| | \/ | \/ __ \| |__ | |__( <_> ) /_/ > | | \ | | /\___ \\ ___/| | \/
  958. // /_______ /__/\_ \ |__| \___ >__| |___| (____ /____/ |_______ \____/\___ /|__|___| / |______//____ >\___ >__|
  959. // \/ \/ \/ \/ \/ \/ /_____/ \/ \/ \/
  960. // ErrExternalLoginUserAlreadyExist represents a "ExternalLoginUserAlreadyExist" kind of error.
  961. type ErrExternalLoginUserAlreadyExist struct {
  962. ExternalID string
  963. UserID int64
  964. LoginSourceID int64
  965. }
  966. // IsErrExternalLoginUserAlreadyExist checks if an error is a ExternalLoginUserAlreadyExist.
  967. func IsErrExternalLoginUserAlreadyExist(err error) bool {
  968. _, ok := err.(ErrExternalLoginUserAlreadyExist)
  969. return ok
  970. }
  971. func (err ErrExternalLoginUserAlreadyExist) Error() string {
  972. return fmt.Sprintf("external login user already exists [externalID: %s, userID: %d, loginSourceID: %d]", err.ExternalID, err.UserID, err.LoginSourceID)
  973. }
  974. // ErrExternalLoginUserNotExist represents a "ExternalLoginUserNotExist" kind of error.
  975. type ErrExternalLoginUserNotExist struct {
  976. UserID int64
  977. LoginSourceID int64
  978. }
  979. // IsErrExternalLoginUserNotExist checks if an error is a ExternalLoginUserNotExist.
  980. func IsErrExternalLoginUserNotExist(err error) bool {
  981. _, ok := err.(ErrExternalLoginUserNotExist)
  982. return ok
  983. }
  984. func (err ErrExternalLoginUserNotExist) Error() string {
  985. return fmt.Sprintf("external login user link does not exists [userID: %d, loginSourceID: %d]", err.UserID, err.LoginSourceID)
  986. }