Compare commits
2 Commits
e81729324c
...
290d1a7bd3
Author | SHA1 | Date | |
---|---|---|---|
290d1a7bd3 | |||
2bc6061e1c |
78
.idea/workspace.xml
generated
78
.idea/workspace.xml
generated
@ -1,78 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="AutoImportSettings">
|
|
||||||
<option name="autoReloadType" value="ALL" />
|
|
||||||
</component>
|
|
||||||
<component name="ChangeListManager">
|
|
||||||
<list default="true" id="0c7a619f-b520-4d41-ab0d-cfa1799d3cdf" name="Changes" comment="">
|
|
||||||
<change beforePath="$PROJECT_DIR$/code.go" beforeDir="false" afterPath="$PROJECT_DIR$/code.go" afterDir="false" />
|
|
||||||
</list>
|
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
||||||
</component>
|
|
||||||
<component name="FileTemplateManagerImpl">
|
|
||||||
<option name="RECENT_TEMPLATES">
|
|
||||||
<list>
|
|
||||||
<option value="Go File" />
|
|
||||||
</list>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="GOROOT" url="file:///usr/local/Cellar/go@1.17/1.17.13/libexec" />
|
|
||||||
<component name="Git.Settings">
|
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
||||||
</component>
|
|
||||||
<component name="GitSEFilterConfiguration">
|
|
||||||
<file-type-list>
|
|
||||||
<filtered-out-file-type name="LOCAL_BRANCH" />
|
|
||||||
<filtered-out-file-type name="REMOTE_BRANCH" />
|
|
||||||
<filtered-out-file-type name="TAG" />
|
|
||||||
<filtered-out-file-type name="COMMIT_BY_MESSAGE" />
|
|
||||||
</file-type-list>
|
|
||||||
</component>
|
|
||||||
<component name="GoLibraries">
|
|
||||||
<option name="indexEntireGoPath" value="false" />
|
|
||||||
</component>
|
|
||||||
<component name="MarkdownSettingsMigration">
|
|
||||||
<option name="stateVersion" value="1" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectId" id="2B4P2ryw4H3y3GlDs3w9wFxFqHs" />
|
|
||||||
<component name="ProjectViewState">
|
|
||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
|
||||||
<option name="showLibraryContents" value="true" />
|
|
||||||
</component>
|
|
||||||
<component name="PropertiesComponent"><![CDATA[{
|
|
||||||
"keyToString": {
|
|
||||||
"RunOnceActivity.go.formatter.settings.were.checked": "true",
|
|
||||||
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
|
||||||
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
|
|
||||||
"WebServerToolWindowFactoryState": "false",
|
|
||||||
"dart.analysis.tool.window.visible": "false",
|
|
||||||
"go.import.settings.migrated": "true",
|
|
||||||
"last_opened_file_path": "/Users/zhangdeman",
|
|
||||||
"node.js.detected.package.eslint": "true",
|
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
|
||||||
"vue.rearranger.settings.migration": "true"
|
|
||||||
}
|
|
||||||
}]]></component>
|
|
||||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
|
||||||
<option name="version" value="3" />
|
|
||||||
</component>
|
|
||||||
<component name="Vcs.Log.Tabs.Properties">
|
|
||||||
<option name="TAB_STATES">
|
|
||||||
<map>
|
|
||||||
<entry key="MAIN">
|
|
||||||
<value>
|
|
||||||
<State />
|
|
||||||
</value>
|
|
||||||
</entry>
|
|
||||||
</map>
|
|
||||||
</option>
|
|
||||||
</component>
|
|
||||||
<component name="VgoProject">
|
|
||||||
<integration-enabled>false</integration-enabled>
|
|
||||||
<settings-migrated>true</settings-migrated>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -23,4 +23,6 @@ type IException interface {
|
|||||||
GetData() interface{}
|
GetData() interface{}
|
||||||
// GetHttpCode *获取当前异常要返回的http状态码, 不设置则 默认 200
|
// GetHttpCode *获取当前异常要返回的http状态码, 不设置则 默认 200
|
||||||
GetHttpCode() int
|
GetHttpCode() int
|
||||||
|
// ToError 转换为内置error类型
|
||||||
|
ToError() error
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,13 @@ func (e *Exception) GetHttpCode() int {
|
|||||||
return e.httpCode
|
return e.httpCode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (e *Exception) ToError() error {
|
||||||
|
if nil == e {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return errors.New(e.Error())
|
||||||
|
}
|
||||||
|
|
||||||
// NewWithCode 仅使用错误码实例化异常
|
// NewWithCode 仅使用错误码实例化异常
|
||||||
//
|
//
|
||||||
// Author : go_developer@163.com<白茶清欢>
|
// Author : go_developer@163.com<白茶清欢>
|
||||||
|
Reference in New Issue
Block a user