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

GitBlitException.java 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*
  2. * Copyright 2011 gitblit.com.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package com.gitblit;
  17. import java.io.IOException;
  18. /**
  19. * GitBlitException is a marginally useful class. :)
  20. *
  21. * @author James Moger
  22. *
  23. */
  24. public class GitBlitException extends IOException {
  25. private static final long serialVersionUID = 1L;
  26. public GitBlitException(String message) {
  27. super(message);
  28. }
  29. public GitBlitException(Throwable cause) {
  30. super(cause);
  31. }
  32. /**
  33. * Exception to indicate that the client should prompt for credentials
  34. * because the requested action requires authentication.
  35. */
  36. public static class UnauthorizedException extends GitBlitException {
  37. private static final long serialVersionUID = 1L;
  38. public UnauthorizedException(String message) {
  39. super(message);
  40. }
  41. }
  42. /**
  43. * Exception to indicate that the requested action can not be executed by
  44. * the specified user.
  45. */
  46. public static class ForbiddenException extends GitBlitException {
  47. private static final long serialVersionUID = 1L;
  48. public ForbiddenException(String message) {
  49. super(message);
  50. }
  51. }
  52. /**
  53. * Exception to indicate that the requested action has been disabled on the
  54. * Gitblit server.
  55. */
  56. public static class NotAllowedException extends GitBlitException {
  57. private static final long serialVersionUID = 1L;
  58. public NotAllowedException(String message) {
  59. super(message);
  60. }
  61. }
  62. /**
  63. * Exception to indicate that the requested action can not be executed by
  64. * the server because it does not recognize the request type.
  65. */
  66. public static class UnknownRequestException extends GitBlitException {
  67. private static final long serialVersionUID = 1L;
  68. public UnknownRequestException(String message) {
  69. super(message);
  70. }
  71. }
  72. }