• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartsheet / smartsheet-java-sdk / #55

02 Oct 2024 07:40PM UTC coverage: 60.548% (+0.7%) from 59.836%
#55

push

github

web-flow
Release prep for 3.2.1 (#103)

4156 of 6864 relevant lines covered (60.55%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/src/main/java/com/smartsheet/api/SmartsheetRestException.java
1
/*
2
 * Copyright (C) 2024 Smartsheet
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

17
package com.smartsheet.api;
18

19
import com.smartsheet.api.models.Error;
20

21
/**
22
 * <p>This is the exception to indicate errors (Error objects of Smartsheet REST API) returned from Smartsheet REST API.</p>
23
 *
24
 * <p>Thread safety: Exceptions are not thread safe.</p>
25
 */
26
public class SmartsheetRestException extends SmartsheetException {
27

28
    /**
29
     * The Constant serialVersionUID.
30
     */
31
    private static final long serialVersionUID = 1L;
32
    /**
33
     * <p>Represents the error code.</p>
34
     *
35
     * <p>It will be initialized in constructor and will not change afterwards.</p>
36
     */
37
    private final int errorCode;
38

39
    /**
40
     * <p>Represents the reference ID.</p>
41
     *
42
     * <p>It will be initialized in the constructor and will not change afterwards.</p>
43
     */
44
    private final String refId;
45

46
    /**
47
     * <p>Represents any error detail provided by the API</p>
48
     *
49
     * <p>It will be initialized in the constructor and will not change afterwards.</p>
50
     */
51
    private final Object detail;
52

53
    /**
54
     * <p>Constructor.</p>
55
     *
56
     * @param error the Error object from Smartsheet REST API
57
     */
58
    public SmartsheetRestException(Error error) {
59
        super(error.getMessage());
1✔
60
        errorCode = error.getErrorCode();
1✔
61
        refId = error.getRefId();
1✔
62
        detail = error.getDetail();
1✔
63
    }
1✔
64

65
    /**
66
     * <p>Returns the error code.</p>
67
     *
68
     * @return the error code
69
     */
70
    public int getErrorCode() {
71
        return this.errorCode;
1✔
72
    }
73

74
    /**
75
     * <p>Retruns the refId.</p>
76
     *
77
     * @return the refId
78
     */
79
    public String getRefId() {
80
        return this.refId;
×
81
    }
82

83
    /**
84
     * <p>Returns the error detail</p>
85
     *
86
     * @return the error detail
87
     */
88
    public Object getDetail() {
89
        return this.detail;
×
90
    }
91
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc